Class: EacRailsUtils::Models::Tableless::AttributesBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_rails_utils/models/tableless.rb

Constant Summary collapse

DATE_TIME_FIELDS =
%i[year month day hour min sec].freeze

Instance Method Summary collapse

Constructor Details

#initialize(model_class, values) ⇒ AttributesBuilder

Returns a new instance of AttributesBuilder.


54
55
56
57
58
# File 'lib/eac_rails_utils/models/tableless.rb', line 54

def initialize(model_class, values)
  @model_class = model_class
  @values = {}
  values.each { |k, v| add(k, v) }
end

Instance Method Details

#to_attributesObject


60
61
62
# File 'lib/eac_rails_utils/models/tableless.rb', line 60

def to_attributes
  @values
end