Class: ActiveRecord::FixtureSet::File
- Inherits:
-
Object
- Object
- ActiveRecord::FixtureSet::File
- Includes:
- Enumerable
- Defined in:
- lib/active_record/fixture_set/file.rb
Overview
:nodoc:
Class Method Summary collapse
-
.open(file) ⇒ Object
Open a fixture file named
file
.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(file) ⇒ File
constructor
A new instance of File.
- #model_class ⇒ Object
Constructor Details
#initialize(file) ⇒ File
Returns a new instance of File.
18 19 20 |
# File 'lib/active_record/fixture_set/file.rb', line 18 def initialize(file) @file = file end |
Class Method Details
.open(file) ⇒ Object
Open a fixture file named file
. When called with a block, the block is called with the filehandle and the filehandle is automatically closed when the block finishes.
13 14 15 16 |
# File 'lib/active_record/fixture_set/file.rb', line 13 def self.open(file) x = new file block_given? ? yield(x) : x end |
Instance Method Details
#each(&block) ⇒ Object
22 23 24 |
# File 'lib/active_record/fixture_set/file.rb', line 22 def each(&block) rows.each(&block) end |
#model_class ⇒ Object
26 27 28 |
# File 'lib/active_record/fixture_set/file.rb', line 26 def model_class config_row["model_class"] end |