Class: FieldMapper::FieldAccessByStandardName
- Inherits:
-
Object
- Object
- FieldMapper::FieldAccessByStandardName
- Defined in:
- lib/field_mapper/custom/field_access_by_standard_name.rb
Instance Method Summary collapse
- #[](standard_name) ⇒ Object
- #[]=(standard_name, value) ⇒ Object
-
#initialize(custom_plat) ⇒ FieldAccessByStandardName
constructor
A new instance of FieldAccessByStandardName.
Constructor Details
#initialize(custom_plat) ⇒ FieldAccessByStandardName
Returns a new instance of FieldAccessByStandardName.
4 5 6 7 |
# File 'lib/field_mapper/custom/field_access_by_standard_name.rb', line 4 def initialize(custom_plat) @custom_plat = custom_plat @fields_by_standard_name = custom_plat.class.fields_by_standard_name end |
Instance Method Details
#[](standard_name) ⇒ Object
9 10 11 12 |
# File 'lib/field_mapper/custom/field_access_by_standard_name.rb', line 9 def [](standard_name) custom_field = field(standard_name) custom_plat[custom_field.name] end |
#[]=(standard_name, value) ⇒ Object
14 15 16 17 |
# File 'lib/field_mapper/custom/field_access_by_standard_name.rb', line 14 def []=(standard_name, value) custom_field = field(standard_name) custom_plat[custom_field.name] = value end |