Class: Importer::ImportedObject::Simple
- Inherits:
-
Object
- Object
- Importer::ImportedObject::Simple
- Defined in:
- lib/importer/imported_object/simple.rb
Overview
Simple imported object details. It’s not stored in database (as with ActiveRecord
imported object).
Attributes:
-
data
- object’s detected attributes hash -
validation_errors
- object’s validation errors hash
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#import ⇒ Object
readonly
Returns the value of attribute import.
-
#object ⇒ Object
Returns the value of attribute object.
-
#state ⇒ Object
Returns the value of attribute state.
-
#validation_errors ⇒ Object
Returns the value of attribute validation_errors.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Simple
constructor
A new instance of Simple.
- #save ⇒ Object (also: #save!)
Constructor Details
#initialize(attributes = {}) ⇒ Simple
Returns a new instance of Simple.
13 14 15 16 |
# File 'lib/importer/imported_object/simple.rb', line 13 def initialize(attributes = {}) raise ArgumentError.new(":import attribute is required.") unless attributes[:import] @import = attributes[:import] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/importer/imported_object/simple.rb', line 11 def data @data end |
#import ⇒ Object (readonly)
Returns the value of attribute import.
10 11 12 |
# File 'lib/importer/imported_object/simple.rb', line 10 def import @import end |
#object ⇒ Object
Returns the value of attribute object.
11 12 13 |
# File 'lib/importer/imported_object/simple.rb', line 11 def object @object end |
#state ⇒ Object
Returns the value of attribute state.
11 12 13 |
# File 'lib/importer/imported_object/simple.rb', line 11 def state @state end |
#validation_errors ⇒ Object
Returns the value of attribute validation_errors.
11 12 13 |
# File 'lib/importer/imported_object/simple.rb', line 11 def validation_errors @validation_errors end |
Instance Method Details
#save ⇒ Object Also known as: save!
18 19 20 |
# File 'lib/importer/imported_object/simple.rb', line 18 def save import.add_object(self) end |