Class: Fixture
- Inherits:
-
Object
- Object
- Fixture
- Defined in:
- lib/active_record/fixtures.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(fixture_path, file) ⇒ Fixture
constructor
A new instance of Fixture.
- #key_list ⇒ Object
- #to_hash ⇒ Object
- #value_list ⇒ Object
Constructor Details
#initialize(fixture_path, file) ⇒ Fixture
Returns a new instance of Fixture.
119 120 121 122 |
# File 'lib/active_record/fixtures.rb', line 119 def initialize(fixture_path, file) @fixture_path, @file = fixture_path, file @fixture = read_fixture end |
Instance Method Details
#[](key) ⇒ Object
124 125 126 |
# File 'lib/active_record/fixtures.rb', line 124 def [](key) @fixture[key] end |
#key_list ⇒ Object
132 133 134 |
# File 'lib/active_record/fixtures.rb', line 132 def key_list @fixture.keys.join(", ") end |
#to_hash ⇒ Object
128 129 130 |
# File 'lib/active_record/fixtures.rb', line 128 def to_hash @fixture end |
#value_list ⇒ Object
136 137 138 |
# File 'lib/active_record/fixtures.rb', line 136 def value_list @fixture.values.map { |v| "'#{v}'" }.join(", ") end |