remind101 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,31 @@ module Remind101::Client::Subscribers
13
13
  api_get("/groups/#{group_id}/subscribers").body
14
14
  end
15
15
 
16
+ # Public: Returns a single subscriber for the given group and subscriber id.
17
+ #
18
+ # Examples
19
+ #
20
+ # remind101.subscriberr 1234, 4321
21
+ # # => { ... }
22
+ #
23
+ # Returns the Hashie::Mash representation of the subscriber.
24
+ def subscriber(group_id, subscriber_id)
25
+ api_get("/groups/#{group_id}/subscribers/#{subscriber_id}").body
26
+ end
27
+
28
+ # Public: Updates a subscriber.
29
+ #
30
+ # Examples
31
+ #
32
+ # remind101.update_subscriber 1234, 4321, attributes
33
+ # # => { ... }
34
+ #
35
+ # Returns the Hashie::Mash representation of the updated subscriber.
36
+ def update_subscriber!(group_id, subscriber_id, attributes)
37
+ api_patch("/groups/#{group_id}/subscribers/#{subscriber_id}", subscriber: attributes).body
38
+ end
39
+ def_rescued :update_subscriber, :update_subscriber!
40
+
16
41
  # Public: Removes a subscriber from the group.
17
42
  #
18
43
  # Examples
@@ -1,3 +1,3 @@
1
1
  module Remind101
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
@@ -62,6 +62,22 @@ describe Remind101::Client do
62
62
  end
63
63
  end
64
64
 
65
+ describe '#subscriber' do
66
+ before { stub_request(:get, "https://api.remind101.com/v2/groups/#{group_id}/subscribers/#{subscriber_id}") }
67
+
68
+ it 'gets the subscriber' do
69
+ client.subscriber(group_id, subscriber_id)
70
+ end
71
+ end
72
+
73
+ describe '#update_subscriber!' do
74
+ before { stub_request(:patch, "https://api.remind101.com/v2/groups/#{group_id}/subscribers/#{subscriber_id}") }
75
+
76
+ it 'updates the subscriber' do
77
+ client.update_subscriber!(group_id, subscriber_id, name: 'foo')
78
+ end
79
+ end
80
+
65
81
  describe '#remove_subscriber!' do
66
82
  before { stub_request(:delete, "https://api.remind101.com/v2/groups/#{group_id}/subscribers/#{subscriber_id}") }
67
83
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remind101
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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-08-30 00:00:00.000000000 Z
12
+ date: 2013-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  segments:
192
192
  - 0
193
- hash: -1908290670246690912
193
+ hash: 4002025153789164095
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  none: false
196
196
  requirements:
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  segments:
201
201
  - 0
202
- hash: -1908290670246690912
202
+ hash: 4002025153789164095
203
203
  requirements: []
204
204
  rubyforge_project:
205
205
  rubygems_version: 1.8.23