Class: SM::FieldsMap
- Inherits:
-
Object
- Object
- SM::FieldsMap
- Defined in:
- lib/entities/fields_map.rb
Overview
map @from to @to aditionally applying a block @block to @to e.g.
for the following fields
{:profile_name => :name, :block => BLOCK}, # => applies the BLOCK on the :name field and put it in profile_name
{:profile_email => :email, :block => BLOCK},
{:profile_website => :website} # => put the :profile_website data on the corresponding :website field
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(from, to, block = nil) ⇒ FieldsMap
constructor
A new instance of FieldsMap.
Constructor Details
#initialize(from, to, block = nil) ⇒ FieldsMap
Returns a new instance of FieldsMap.
12 13 14 15 16 |
# File 'lib/entities/fields_map.rb', line 12 def initialize(from, to, block = nil) @from = from @to = to @block= block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
11 12 13 |
# File 'lib/entities/fields_map.rb', line 11 def block @block end |
#from ⇒ Object
Returns the value of attribute from.
11 12 13 |
# File 'lib/entities/fields_map.rb', line 11 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
11 12 13 |
# File 'lib/entities/fields_map.rb', line 11 def to @to end |