Sha256: 295af04dbf3d9418568aa3eae0839b96d9889cfc212fb4136468f1b335a18ea1
Contents?: true
Size: 526 Bytes
Versions: 7
Compression:
Stored size: 526 Bytes
Contents
module Panda module Updatable def save new? ? create : update end def save! save || raise("Resource invalid") end def update_attribute(name, value) self.send("#{name}=".to_sym, value) self.save end def update_attributes(attributes) load(attributes) && save end def update response = connection.put(object_url_map(self.class.one_path), @changed_attributes) load_response(response) ? (@changed_attributes = {}; true) : false end end end
Version data entries
7 entries across 7 versions & 2 rubygems