dropio 1.7.5 → 1.7.6
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/dropio.gemspec +1 -1
- data/lib/dropio/api.rb +3 -0
- data/lib/dropio/client.rb +7 -1
- data/lib/dropio/subscription.rb +2 -2
- data/lib/dropio.rb +1 -1
- metadata +2 -2
data/dropio.gemspec
CHANGED
data/lib/dropio/api.rb
CHANGED
@@ -180,6 +180,9 @@ class Dropio::Api
|
|
180
180
|
self.class.get("/drops/#{drop_name}/subscriptions", :query => {:token => admin_token, :page => page, :show_pagination_details => true})
|
181
181
|
end
|
182
182
|
|
183
|
+
def delete_subscription(drop_name, subscription_id, admin_token)
|
184
|
+
self.class.delete("/drops/#{drop_name}/subscriptions/#{subscription_id}", :body => {:token => admin_token})
|
185
|
+
end
|
183
186
|
|
184
187
|
private
|
185
188
|
|
data/lib/dropio/client.rb
CHANGED
@@ -185,7 +185,8 @@ class Dropio::Client
|
|
185
185
|
end
|
186
186
|
|
187
187
|
def create_email_subscription(drop, emails, welcome_message, welcome_subject, welcome_from, message, events)
|
188
|
-
s = handle(:
|
188
|
+
s = handle(:subscriptions, self.service.create_email_subscription(drop.name, emails, welcome_message, welcome_subject, welcome_from, message, events, drop.default_token))
|
189
|
+
s = s.first
|
189
190
|
s.drop = drop
|
190
191
|
s
|
191
192
|
end
|
@@ -202,6 +203,11 @@ class Dropio::Client
|
|
202
203
|
subscriptions
|
203
204
|
end
|
204
205
|
|
206
|
+
def delete_subscription(subscription)
|
207
|
+
r = handle(:response, self.service.delete_subscription(subscription.drop.name,subscription.id,subscription.drop.default_token))
|
208
|
+
r["result"]
|
209
|
+
end
|
210
|
+
|
205
211
|
private
|
206
212
|
|
207
213
|
def handle(type, response)
|
data/lib/dropio/subscription.rb
CHANGED
@@ -2,8 +2,8 @@ class Dropio::Subscription < Dropio::Resource
|
|
2
2
|
attr_accessor :id, :username, :message, :type, :drop
|
3
3
|
|
4
4
|
# Destroys the given subscription. Admin +token+ required
|
5
|
-
def destroy!
|
6
|
-
Dropio::Resource.client.delete_subscription(self
|
5
|
+
def destroy!
|
6
|
+
Dropio::Resource.client.delete_subscription(self)
|
7
7
|
nil
|
8
8
|
end
|
9
9
|
|
data/lib/dropio.rb
CHANGED