Class: Kibutsu::Fixture
- Inherits:
-
Object
- Object
- Kibutsu::Fixture
- Defined in:
- lib/kibutsu/fixture.rb
Overview
Corresponds to one named fixture from a fixture file.
Constant Summary collapse
- TIMESTAMP_COLUMN_NAMES =
%w[created_at updated_at].freeze
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #enriched_attributes ⇒ Object
-
#initialize(table, name, attributes) ⇒ Fixture
constructor
A new instance of Fixture.
Constructor Details
#initialize(table, name, attributes) ⇒ Fixture
Returns a new instance of Fixture.
8 9 10 11 12 |
# File 'lib/kibutsu/fixture.rb', line 8 def initialize(table, name, attributes) @table = table @name = name @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
20 21 22 |
# File 'lib/kibutsu/fixture.rb', line 20 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
20 21 22 |
# File 'lib/kibutsu/fixture.rb', line 20 def name @name end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
20 21 22 |
# File 'lib/kibutsu/fixture.rb', line 20 def table @table end |
Instance Method Details
#enriched_attributes ⇒ Object
14 15 16 17 18 |
# File 'lib/kibutsu/fixture.rb', line 14 def enriched_attributes enriched_attributes = enrich_with_id(attributes) enriched_attributes = enrich_with_foreign_keys(enriched_attributes) (enriched_attributes) end |