Class: Hovercraft::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/hovercraft/loader.rb

Instance Method Summary collapse

Constructor Details

#initializeLoader

Returns a new instance of Loader.



6
7
8
# File 'lib/hovercraft/loader.rb', line 6

def initialize
  @caller = Caller.new
end

Instance Method Details

#modelsObject



18
19
20
# File 'lib/hovercraft/loader.rb', line 18

def models
  @models ||= require_models
end

#with_each_modelObject



10
11
12
13
14
15
16
# File 'lib/hovercraft/loader.rb', line 10

def with_each_model
  models.each do |model_class|
    model_name = model_class.name.underscore
    plural_model_name = model_name.pluralize
    yield(model_class, model_name, plural_model_name)
  end
end