Sha256: 9073a3c812c26d828c155394d5cd575dfa5bd257472ff0186b825f754f38bda4
Contents?: true
Size: 741 Bytes
Versions: 8
Compression:
Stored size: 741 Bytes
Contents
module Restly::Base::Instance::Actions def save run_callbacks :save do @previously_changed = changes @changed_attributes.clear new_record? ? create : update end self end def delete response = connection.delete(path_with_format, params: params) freeze response.status < 300 end def destroy run_callbacks :destroy do delete end end private def update run_callbacks :update do set_attributes_from_response(connection.put path_with_format, body: @request_body, params: params) end end def create run_callbacks :create do set_attributes_from_response(connection.post path_with_format, body: @request_body, params: params) end end end
Version data entries
8 entries across 8 versions & 1 rubygems