allplayers 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/allplayers.gemspec CHANGED
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
20
20
  spec.required_rubygems_version = Gem::Requirement.new('>= 1.3.6')
21
21
  spec.summary = spec.description
22
22
  spec.test_files = Dir.glob("spec/**/*")
23
- spec.version = '0.1.3'
23
+ spec.version = '0.1.4'
24
24
  end
@@ -11,5 +11,22 @@ module AllPlayers
11
11
  def assign_submission(form_uuid, submission_id, user_uuid, html = 0)
12
12
  post 'forms/' + form_uuid + '/assign_submission/' + submission_id.to_s, {:user_uuid => user_uuid, :html => html}
13
13
  end
14
+
15
+ def create_submission(form_uuid, data = {}, user_uuid = nil)
16
+ formatted_data = {}
17
+ data.each do |cid, value|
18
+ formatted_data.merge!(cid => {:value => {0 => value}})
19
+ end
20
+ submission = {:data => formatted_data}
21
+
22
+ unless user_uuid.nil?
23
+ submission.merge!(:user_uuid => user_uuid)
24
+ end
25
+ post 'submissions', {:webform => form_uuid, :submission => submission}
26
+ end
27
+
28
+ def get_webform(form_uuid)
29
+ get 'webforms/' + form_uuid
30
+ end
14
31
  end
15
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allplayers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-19 00:00:00.000000000 Z
12
+ date: 2014-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -132,20 +132,20 @@ extra_rdoc_files: []
132
132
  files:
133
133
  - README.md
134
134
  - allplayers.gemspec
135
- - lib/allplayers/monkey_patches/rest_client.rb
136
- - lib/allplayers/error/decode_error.rb
137
- - lib/allplayers/error/restclient_error.rb
135
+ - lib/allplayers/api.rb
138
136
  - lib/allplayers/authentication.rb
139
- - lib/allplayers/error.rb
137
+ - lib/allplayers/client/events.rb
140
138
  - lib/allplayers/client/forms.rb
141
139
  - lib/allplayers/client/groups.rb
142
140
  - lib/allplayers/client/users.rb
143
- - lib/allplayers/client/events.rb
144
- - lib/allplayers/configuration.rb
145
141
  - lib/allplayers/client.rb
146
- - lib/allplayers/request.rb
142
+ - lib/allplayers/configuration.rb
143
+ - lib/allplayers/error/decode_error.rb
144
+ - lib/allplayers/error/restclient_error.rb
145
+ - lib/allplayers/error.rb
146
+ - lib/allplayers/monkey_patches/rest_client.rb
147
147
  - lib/allplayers/rate_limit.rb
148
- - lib/allplayers/api.rb
148
+ - lib/allplayers/request.rb
149
149
  - lib/allplayers.rb
150
150
  - lib/helpers/http_encoding_helper.rb
151
151
  homepage: http://www.allplayers.com/