ohmage 0.0.13 → 0.0.14

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca406f07787c197940ee99b378dc999ae07f1f51
4
- data.tar.gz: 3dbe178efc253263ae054f014d58d058f96c35a0
3
+ metadata.gz: 902f9e908e3845442fda29cac033db72adc9de7d
4
+ data.tar.gz: 4b71bb2eec030da340da38f11a3a32614575e02c
5
5
  SHA512:
6
- metadata.gz: 855116d760066bc928504da5b1c92a1eed6bdfa232580d684ab6d470127cf698acfa0b33c19818d17c311838e38b2d1a9a0e063d7fd315747e01b9b8d2232d5c
7
- data.tar.gz: 89f79871d435c0fcfa25a05c7f77945c363f33948da5d06a52488d51674aa2d3ef9deb49470118ab7b58f6eebf12fe4d4c749b45b99533ca40844948d4342812
6
+ metadata.gz: ebe4eb2cc65c5cd26ad07091d2dab8497b043b73fb5be1cbfa85d22060b616965ee335e7fff28bccb04af7daa4c9026eeceda63e7098801a416be13b53b4551c
7
+ data.tar.gz: 914c58112659053d1bd5b865bac750bba99a6f8cb51c6e54a3d106fe5f767a6ad6ac2b1729a89d9f44bb569394c5a8afa6568d0e11d9a4ad886d940347756381
@@ -40,10 +40,30 @@ module Ohmage
40
40
  campaign_read(campaign_urn_list: params[:campaign_urn])
41
41
  end
42
42
 
43
+ #
44
+ # ohmage campaign/delete call
45
+ # @see https://github.com/ohmage/server/wiki/Campaign-Manipulation#campaignDelete
46
+ # @returns string of success/fail
47
+ #
43
48
  def campaign_delete(params = {})
44
49
  request = Ohmage::Request.new(self, :post, 'campaign/delete', params)
45
50
  request.perform
46
51
  end
52
+
53
+ #
54
+ # ohmage campaign/search call
55
+ # @see https://github.com/ohmage/server/wiki/Campaign-Manipulation#campaignSearch
56
+ # @returns [Array: Ohmage::Campaign objects]
57
+ #
58
+ def campaign_search(params = {})
59
+ request = Ohmage::Request.new(self, :post, 'campaign/search', params)
60
+ # TODO: make a utility to abstract creation of array of base objects
61
+ t = []
62
+ request.perform[:data].each do |k, v|
63
+ t << Ohmage::Campaign.new(k => v)
64
+ end
65
+ t
66
+ end
47
67
  end
48
68
  end
49
69
  end
@@ -39,10 +39,25 @@ module Ohmage
39
39
  request.perform
40
40
  end
41
41
 
42
+ #
43
+ # ohmage document/delete call
44
+ # @see https://github.com/ohmage/server/wiki/Document-Manipulation#documentDelete
45
+ # @returns string with success/fail
46
+ #
42
47
  def document_delete(params = {})
43
48
  request = Ohmage::Request.new(self, :post, 'document/delete', params)
44
49
  request.perform
45
50
  end
51
+
52
+ #
53
+ # ohmage document/read/contents call
54
+ # @see https://github.com/ohmage/server/wiki/Document-Manipulation#documentUpdate
55
+ # @returns [Binary File] from raw HTTP Response Body.
56
+ #
57
+ def document_contents(params = {})
58
+ request = Ohmage::Request.new(self, :post, 'document/read/contents', params)
59
+ request.perform
60
+ end
46
61
  end
47
62
  end
48
63
  end
data/lib/ohmage/media.rb CHANGED
@@ -5,6 +5,7 @@ module Ohmage
5
5
  # ohmage media/read call
6
6
  # @see https://github.com/ohmage/server/wiki/Media-Manipulation#mediaRead
7
7
  # @returns [Binary File] from raw HTTP Response Body.
8
+ #
8
9
  def media_read(params = {})
9
10
  # support for media/read exists only in 2.17+
10
11
  if server_config[:application_version].to_f >= 2.17
data/lib/ohmage/survey.rb CHANGED
@@ -27,7 +27,7 @@ module Ohmage
27
27
  #
28
28
  # ohmage survey_response/update call
29
29
  # @see https://github.com/ohmage/server/wiki/Survey-Manipulation#surveyResponseUpdatePrivacyState
30
- # @returns nil
30
+ # @returns success/fail as string.
31
31
  #
32
32
  def survey_response_update(params = {})
33
33
  request = Ohmage::Request.new(self, :post, 'survey_response/update', params)
@@ -37,7 +37,7 @@ module Ohmage
37
37
  #
38
38
  # ohmage survey_response/delete call
39
39
  # @see https://github.com/ohmage/server/wiki/Survey-Manipulation#surveyResponseDelete
40
- # @returns nil
40
+ # @returns success/fail as string.
41
41
  #
42
42
  def survey_response_delete(params = {})
43
43
  request = Ohmage::Request.new(self, :post, 'survey_response/delete', params)
@@ -47,7 +47,7 @@ module Ohmage
47
47
  #
48
48
  # ohmage survey/upload call
49
49
  # @see https://github.com/ohmage/server/wiki/Survey-Manipulation#surveyUpload
50
- # @returns nil
50
+ # @returns success/fail as string.
51
51
  #
52
52
  def survey_upload(params = {})
53
53
  # loop around params, finding attached images/files, set them as form data.
@@ -58,7 +58,6 @@ module Ohmage
58
58
  end
59
59
  next
60
60
  end
61
- p params
62
61
  request = Ohmage::Request.new(self, :post, 'survey/upload', params)
63
62
  request.perform
64
63
  end
@@ -14,7 +14,7 @@ module Ohmage
14
14
 
15
15
  # @return [Integer]
16
16
  def patch
17
- 13
17
+ 14
18
18
  end
19
19
 
20
20
  # @return [Integer, NilClass]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohmage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Nolen