Class: Csvbuilder::Import::Attribute
- Inherits:
-
AttributeBase
- Object
- AttributeBase
- Csvbuilder::Import::Attribute
- Defined in:
- lib/csvbuilder/importer/internal/import/attribute.rb
Instance Attribute Summary collapse
-
#attribute_errors ⇒ Object
readonly
Returns the value of attribute attribute_errors.
-
#source_value ⇒ Object
readonly
Returns the value of attribute source_value.
Instance Method Summary collapse
-
#initialize(column_name, source_value, attribute_errors, row_model) ⇒ Attribute
constructor
A new instance of Attribute.
- #parsed_value ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(column_name, source_value, attribute_errors, row_model) ⇒ Attribute
Returns a new instance of Attribute.
10 11 12 13 14 15 |
# File 'lib/csvbuilder/importer/internal/import/attribute.rb', line 10 def initialize(column_name, source_value, attribute_errors, row_model) @source_value = source_value @attribute_errors = attribute_errors || [] super(column_name, row_model) end |
Instance Attribute Details
#attribute_errors ⇒ Object (readonly)
Returns the value of attribute attribute_errors.
8 9 10 |
# File 'lib/csvbuilder/importer/internal/import/attribute.rb', line 8 def attribute_errors @attribute_errors end |
#source_value ⇒ Object (readonly)
Returns the value of attribute source_value.
8 9 10 |
# File 'lib/csvbuilder/importer/internal/import/attribute.rb', line 8 def source_value @source_value end |
Instance Method Details
#parsed_value ⇒ Object
25 26 27 |
# File 'lib/csvbuilder/importer/internal/import/attribute.rb', line 25 def parsed_value @parsed_value ||= formatted_value end |
#value ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/csvbuilder/importer/internal/import/attribute.rb', line 17 def value @value ||= if attribute_errors.present? nil else formatted_value end end |