Class: Kibutsu::FixtureTable

Inherits:
Object
  • Object
show all
Defined in:
lib/kibutsu/fixture_table.rb

Overview

A database table in the fixture world.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_namesObject

Returns the value of attribute column_names.



31
32
33
# File 'lib/kibutsu/fixture_table.rb', line 31

def column_names
  @column_names
end

#fixturesObject (readonly)

Returns the value of attribute fixtures.



28
29
30
# File 'lib/kibutsu/fixture_table.rb', line 28

def fixtures
  @fixtures
end

#foreign_key_columnsObject

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_tablesObject (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

#nameObject (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_tablesObject



16
17
18
# File 'lib/kibutsu/fixture_table.rb', line 16

def foreign_key_target_tables
  @foreign_key_columns.map(&:target_table)
end