Module: DmAdapter::InstanceMethods

Defined in:
lib/models/dm_adapter.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



39
40
41
42
# File 'lib/models/dm_adapter.rb', line 39

def method_missing(meth, *args, &block)
  #cool I just found out * on an array turns the array into a list of args for a function
  @instance.send(meth, *args, &block)
end

Instance Method Details

#update(attributes) ⇒ Object



34
35
36
37
# File 'lib/models/dm_adapter.rb', line 34

def update(attributes)
  @instance.update_attributes attributes
  @instance.save
end