Class: Kibutsu::FixtureTable
- Inherits:
-
Object
- Object
- Kibutsu::FixtureTable
- Defined in:
- lib/kibutsu/fixture_table.rb
Overview
A database table in the fixture world.
Instance Attribute Summary collapse
-
#column_names ⇒ Object
Returns the value of attribute column_names.
-
#fixtures ⇒ Object
readonly
Returns the value of attribute fixtures.
-
#foreign_key_columns ⇒ Object
Returns the value of attribute foreign_key_columns.
-
#foreign_key_source_tables ⇒ Object
readonly
Returns the value of attribute foreign_key_source_tables.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<<(fixture) ⇒ Object
- #foreign_key_target_tables ⇒ Object
-
#initialize(name) ⇒ FixtureTable
constructor
A new instance of FixtureTable.
Constructor Details
#initialize(name) ⇒ FixtureTable
Returns a new instance of FixtureTable.
4 5 6 7 8 9 10 |
# File 'lib/kibutsu/fixture_table.rb', line 4 def initialize(name) @name = name @column_names = nil @foreign_key_columns = nil @foreign_key_source_tables = [] @fixtures = [] end |
Instance Attribute Details
#column_names ⇒ Object
Returns the value of attribute column_names.
31 32 33 |
# File 'lib/kibutsu/fixture_table.rb', line 31 def column_names @column_names end |
#fixtures ⇒ Object (readonly)
Returns the value of attribute fixtures.
28 29 30 |
# File 'lib/kibutsu/fixture_table.rb', line 28 def fixtures @fixtures end |
#foreign_key_columns ⇒ Object
Returns the value of attribute foreign_key_columns.
28 29 30 |
# File 'lib/kibutsu/fixture_table.rb', line 28 def foreign_key_columns @foreign_key_columns end |
#foreign_key_source_tables ⇒ Object (readonly)
Returns the value of attribute foreign_key_source_tables.
28 29 30 |
# File 'lib/kibutsu/fixture_table.rb', line 28 def foreign_key_source_tables @foreign_key_source_tables end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/kibutsu/fixture_table.rb', line 28 def name @name end |
Instance Method Details
#<<(fixture) ⇒ Object
12 13 14 |
# File 'lib/kibutsu/fixture_table.rb', line 12 def <<(fixture) @fixtures << fixture end |
#foreign_key_target_tables ⇒ Object
16 17 18 |
# File 'lib/kibutsu/fixture_table.rb', line 16 def foreign_key_target_tables @foreign_key_columns.map(&:target_table) end |