Class: Rails3::Engine

Inherits:
Plugin
  • Object
show all
Defined in:
lib/r3_plugin_toolbox/engine.rb

Defined Under Namespace

Modules: Assist

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Engine

Returns a new instance of Engine.



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/r3_plugin_toolbox/engine.rb', line 21

def initialize name, &block
  @name = name
  module_name = name.to_s.camelize
  make_engine module_name
  
  engine = "#{module_name}::Engine".constantize
  
  if block
    block.arity < 1 ? engine.instance_eval(&block) : block.call(engine)  
  end
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/r3_plugin_toolbox/engine.rb', line 19

def name
  @name
end