Class: ActiveRecord::FixtureSet::File
- Includes:
- Enumerable
- Defined in:
- activerecord/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
- #ignored_fixtures ⇒ Object
-
#initialize(file) ⇒ File
constructor
A new instance of File.
- #model_class ⇒ Object
Methods included from Enumerable
Constructor Details
#initialize(file) ⇒ File
Returns a new instance of File.
19 20 21 |
# File 'activerecord/lib/active_record/fixture_set/file.rb', line 19 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.
14 15 16 17 |
# File 'activerecord/lib/active_record/fixture_set/file.rb', line 14 def self.open(file) x = new file block_given? ? yield(x) : x end |
Instance Method Details
#each(&block) ⇒ Object
23 24 25 |
# File 'activerecord/lib/active_record/fixture_set/file.rb', line 23 def each(&block) rows.each(&block) end |
#ignored_fixtures ⇒ Object
31 32 33 |
# File 'activerecord/lib/active_record/fixture_set/file.rb', line 31 def ignored_fixtures config_row["ignore"] end |
#model_class ⇒ Object
27 28 29 |
# File 'activerecord/lib/active_record/fixture_set/file.rb', line 27 def model_class config_row["model_class"] end |