Class: ActiveRecordImporter::Attribute::AttributesBuilder

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/active_record_importer/attribute/attributes_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#force_utf8_encode, #parse_datetime, #time_attributes

Constructor Details

#initialize(importable, row_attrs) ⇒ AttributesBuilder



14
15
16
17
18
# File 'lib/active_record_importer/attribute/attributes_builder.rb', line 14

def initialize(importable, row_attrs)
  @importable = importable
  @row_attrs = row_attrs
  @processed_attrs = {}
end

Instance Attribute Details

#importableObject (readonly)

Returns the value of attribute importable.



6
7
8
# File 'lib/active_record_importer/attribute/attributes_builder.rb', line 6

def importable
  @importable
end

#processed_attrsObject (readonly)

Returns the value of attribute processed_attrs.



6
7
8
# File 'lib/active_record_importer/attribute/attributes_builder.rb', line 6

def processed_attrs
  @processed_attrs
end

#row_attrsObject (readonly)

Returns the value of attribute row_attrs.



6
7
8
# File 'lib/active_record_importer/attribute/attributes_builder.rb', line 6

def row_attrs
  @row_attrs
end

Instance Method Details

#buildObject



20
21
22
23
24
# File 'lib/active_record_importer/attribute/attributes_builder.rb', line 20

def build
  force_encode_attributes
  fetch_time_attributes
  processed_attrs
end