lib/rest/api/client.rb in rest-api-client-0.1.10 vs lib/rest/api/client.rb in rest-api-client-0.1.11
- old
+ new
@@ -40,9 +40,15 @@
def self.get(id)
self.find id
end
+ def refresh
+ response = perform_get "#{path}/#{id}", {:type => self.class}
+ update_attributes(response)
+ self
+ end
+
def save!
return false unless valid?
begin
update_attributes(perform_post path, get_params)
self