Module: N4j::Field

Extended by:
ActiveSupport::Concern
Defined in:
lib/n4j/field.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#data_access(key) ⇒ Object



17
18
19
# File 'lib/n4j/field.rb', line 17

def data_access(key)
  data && data[key.to_s]
end

#data_set(key, new_value) ⇒ Object



21
22
23
24
# File 'lib/n4j/field.rb', line 21

def data_set(key, new_value)
  new_data = data.merge({key.to_s => new_value})
  self.data = new_data
end