Class: HasDynamicColumns::DynamicColumnDatum

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/has_dynamic_columns/dynamic_column_datum.rb

Instance Method Summary collapse

Instance Method Details

#valueObject



15
16
17
# File 'lib/has_dynamic_columns/dynamic_column_datum.rb', line 15

def value
	self.datum.value if self.datum
end

#value=(v) ⇒ Object



9
10
11
12
13
14
# File 'lib/has_dynamic_columns/dynamic_column_datum.rb', line 9

def value=v
	data_type = "string"
	data_type = self.dynamic_column.data_type if self.dynamic_column

	self.datum = "::HasDynamicColumns::DynamicColumn#{data_type.capitalize}Datum".constantize.new(value: v)
end