Class: FixtureBot::TableLoader
- Inherits:
-
Object
- Object
- FixtureBot::TableLoader
- Defined in:
- lib/fixture_bot/table_loader.rb
Instance Attribute Summary collapse
-
#fixtures ⇒ Object
readonly
Returns the value of attribute fixtures.
-
#fixtures_with_id ⇒ Object
readonly
Returns the value of attribute fixtures_with_id.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #fixture(name, &block) ⇒ Object
- #fixture_with_id(name, &block) ⇒ Object
-
#initialize(table) ⇒ TableLoader
constructor
A new instance of TableLoader.
Constructor Details
#initialize(table) ⇒ TableLoader
Returns a new instance of TableLoader.
7 8 9 10 11 |
# File 'lib/fixture_bot/table_loader.rb', line 7 def initialize(table) @table = table @fixtures = [] @fixtures_with_id = [] end |
Instance Attribute Details
#fixtures ⇒ Object (readonly)
Returns the value of attribute fixtures.
5 6 7 |
# File 'lib/fixture_bot/table_loader.rb', line 5 def fixtures @fixtures end |
#fixtures_with_id ⇒ Object (readonly)
Returns the value of attribute fixtures_with_id.
5 6 7 |
# File 'lib/fixture_bot/table_loader.rb', line 5 def fixtures_with_id @fixtures_with_id end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
5 6 7 |
# File 'lib/fixture_bot/table_loader.rb', line 5 def table @table end |
Instance Method Details
#fixture(name, &block) ⇒ Object
13 14 15 |
# File 'lib/fixture_bot/table_loader.rb', line 13 def fixture(name, &block) @fixtures << ["#{table}/#{name}", block] end |
#fixture_with_id(name, &block) ⇒ Object
17 18 19 |
# File 'lib/fixture_bot/table_loader.rb', line 17 def fixture_with_id(name, &block) @fixtures_with_id << ["#{table}/#{name}", block] end |