Class: FastSeeder::Seeders::InlineSeeder::DataContext
- Inherits:
-
Object
- Object
- FastSeeder::Seeders::InlineSeeder::DataContext
- Defined in:
- lib/fast_seeder/seeders/inline_seeder.rb
Instance Attribute Summary collapse
-
#records ⇒ Object
readonly
Returns the value of attribute records.
Instance Method Summary collapse
-
#initialize(data_block) ⇒ DataContext
constructor
A new instance of DataContext.
- #record(*args) ⇒ Object
Constructor Details
#initialize(data_block) ⇒ DataContext
Returns a new instance of DataContext.
7 8 9 10 |
# File 'lib/fast_seeder/seeders/inline_seeder.rb', line 7 def initialize(data_block) @records = [] instance_eval(&data_block) end |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
5 6 7 |
# File 'lib/fast_seeder/seeders/inline_seeder.rb', line 5 def records @records end |
Instance Method Details
#record(*args) ⇒ Object
12 13 14 |
# File 'lib/fast_seeder/seeders/inline_seeder.rb', line 12 def record(*args) @records << args end |