Module: RPCMapper::Mutable::InstanceMethods

Defined in:
lib/rpc_mapper/mutable.rb

Instance Method Summary collapse

Instance Method Details

#[]=(attribute, value) ⇒ Object



28
29
30
# File 'lib/rpc_mapper/mutable.rb', line 28

def []=(attribute, value)
  set_attribute(attribute, value)
end

#attributes=(attributes) ⇒ Object



32
33
34
# File 'lib/rpc_mapper/mutable.rb', line 32

def attributes=(attributes)
  set_attributes(attributes)
end

#destroyObject Also known as: delete



45
46
47
# File 'lib/rpc_mapper/mutable.rb', line 45

def destroy
  delete_http
end

#saveObject



36
37
38
# File 'lib/rpc_mapper/mutable.rb', line 36

def save
  new_record? ? post_http(build_params_from_attributes) : put_http(build_params_from_attributes)
end

#update_attributes(attributes) ⇒ Object



40
41
42
43
# File 'lib/rpc_mapper/mutable.rb', line 40

def update_attributes(attributes)
  self.attributes = attributes
  save
end