Class: FixtureOverlord::ReadFixture
- Inherits:
-
Object
- Object
- FixtureOverlord::ReadFixture
- Defined in:
- lib/fixture_overlord/read_fixture.rb
Instance Method Summary collapse
-
#initialize(file) ⇒ ReadFixture
constructor
A new instance of ReadFixture.
- #read(key = nil) ⇒ Object
Constructor Details
#initialize(file) ⇒ ReadFixture
13 14 15 |
# File 'lib/fixture_overlord/read_fixture.rb', line 13 def initialize(file) @file = file end |
Instance Method Details
#read(key = nil) ⇒ Object
17 18 19 20 21 |
# File 'lib/fixture_overlord/read_fixture.rb', line 17 def read(key = nil) hash = read_file hash = hash[key.to_s] unless key.nil? Hashish[hash].symbolize_keys end |