Class: FieldMapper::FieldAccessByStandardName

Inherits:
Object
  • Object
show all
Defined in:
lib/field_mapper/custom/field_access_by_standard_name.rb

Instance Method Summary collapse

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