Class: Fill::Configure
- Inherits:
-
Object
- Object
- Fill::Configure
- Defined in:
- lib/fill/configure.rb
Instance Method Summary collapse
- #environment(env, which, options = {}) ⇒ Object
- #fill(model, field, *values) ⇒ Object
- #invoke(task, *models) ⇒ Object
- #perform! ⇒ Object
- #produce(*models, &block) ⇒ Object
Instance Method Details
#environment(env, which, options = {}) ⇒ Object
27 28 29 |
# File 'lib/fill/configure.rb', line 27 def environment(env, which, = {}) end |
#fill(model, field, *values) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/fill/configure.rb', line 12 def fill(model, field, *values) = values. self.produce model, do values.each do |value| model.to_s.singularize.camelize.constantize.create!(field => value) end end end |
#invoke(task, *models) ⇒ Object
21 22 23 24 25 |
# File 'lib/fill/configure.rb', line 21 def invoke(task, *models) self.produce *models do Rake::Task[task].invoke end end |
#perform! ⇒ Object
31 32 33 |
# File 'lib/fill/configure.rb', line 31 def perform! registered.each_key { |model| perform(model) } end |