Module: Cassie::Statements::Statement::Mapping::ClassMethods
- Included in:
- Assignments, Deleting, Cassie::Statements::Statement::Mapping
- Defined in:
- lib/cassie/statements/statement/mapping.rb
Instance Method Summary collapse
-
#map_from(resource_name) ⇒ Object
DSL setting a getter and setter.
Instance Method Details
#map_from(resource_name) ⇒ Object
Note:
This delegation behavor gets last preference.
-
An overwritten
column_name
getter has first preference -
the @column_name instance variable has next preference
-
the mapped resource delegation has last preference
DSL setting a getter and setter.
When use with a relation (where
) or assignment (set
), the fetching of column values are delegated to the object in this getter.
41 42 43 44 45 46 47 48 49 |
# File 'lib/cassie/statements/statement/mapping.rb', line 41 def map_from(resource_name) define_method resource_name do _resource end define_method "#{resource_name}=" do |val| self._resource = val end end |