lib/restful_model.rb in inbox-1.0.0 vs lib/restful_model.rb in inbox-1.1.0
- old
+ new
@@ -8,10 +8,11 @@
parameter :id
parameter :account_id
parameter :cursor # Only used by the delta sync API
time_attr_accessor :created_at
+ attr_reader :raw_json
def self.collection_name
"#{self.to_s.downcase}s".split('::').last
end
@@ -24,10 +25,11 @@
def ==(comparison_object)
comparison_object.equal?(self) || (comparison_object.instance_of?(self.class) && comparison_object.id == id)
end
def inflate(json)
+ @raw_json = json
parameters.each do |property_name|
send("#{property_name}=", json[property_name]) if json.has_key?(property_name)
end
end
@@ -68,11 +70,11 @@
end
end
self
end
- def destroy
- ::RestClient.send('delete', self.url) do |response, request|
+ def destroy(params = {})
+ ::RestClient.send('delete', self.url, :params => params) do |response, request|
Inbox.interpret_http_status(response)
end
end
end