Class: Rails3::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/r3_plugin_toolbox/macro.rb,
lib/r3_plugin_toolbox/railtie.rb,
lib/r3_plugin_toolbox/extender.rb,
lib/r3_plugin_toolbox/extender/util.rb,
lib/r3_plugin_toolbox/extender/load_handler.rb,
lib/r3_plugin_toolbox/rspec/matchers/be_extended_with.rb

Direct Known Subclasses

Engine

Defined Under Namespace

Modules: Assist Classes: Extender

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Plugin

Returns a new instance of Plugin.



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/r3_plugin_toolbox/railtie.rb', line 32

def initialize name, &block
  @name = name

  module_name = name.to_s.camelize
  make_railtie module_name
  
  railtie = "#{module_name}::Railtie".constantize

  if block
    block.arity < 1 ? railtie.instance_eval(&block) : block.call(railtie)  
  end      
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



30
31
32
# File 'lib/r3_plugin_toolbox/railtie.rb', line 30

def name
  @name
end