lib/parse/push.rb in parse-ruby-client-0.1.1 vs lib/parse/push.rb in parse-ruby-client-0.1.2
- old
+ new
@@ -3,10 +3,11 @@
module Parse
class Push
attr_accessor :channels
attr_accessor :channel
+ attr_accessor :where
attr_accessor :type
attr_accessor :expiration_time_interval
attr_accessor :expiration_time
attr_accessor :data
@@ -15,21 +16,25 @@
@channel = channel
end
def save
uri = Protocol.push_uri
-
+
body = { :data => @data, :channel => @channel }
-
+
if @channels
body.merge!({ :channels => @channels })
body.delete :channel
end
-
+
+ if @where
+ body.merge!({ :where => @where })
+ end
+
body.merge!({ :expiration_time_interval => @expiration_time_interval }) if @expiration_time_interval
- body.merge!({ :expiration_time => @expiration_time }) if @expiration_time
+ body.merge!({ :expiration_time => @expiration_time }) if @expiration_time
body.merge!({ :type => @type }) if @type
-
+
response = Parse.client.request uri, :post, body.to_json, nil
end
end
\ No newline at end of file