Class: DIY::FactoryDef
- Inherits:
-
Object
- Object
- DIY::FactoryDef
- Defined in:
- lib/diy/factory.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#library ⇒ Object
Returns the value of attribute library.
-
#name ⇒ Object
Returns the value of attribute name.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(opts) ⇒ FactoryDef
constructor
A new instance of FactoryDef.
Constructor Details
#initialize(opts) ⇒ FactoryDef
Returns a new instance of FactoryDef.
5 6 7 8 9 10 11 |
# File 'lib/diy/factory.rb', line 5 def initialize(opts) @name, @target, @library, @auto_require = opts[:name], opts[:target], opts[:library], opts[:auto_require] @class_name = Infl.camelize(@target) @library ||= Infl.underscore(@class_name) if @auto_require end |
Instance Attribute Details
#class_name ⇒ Object
Returns the value of attribute class_name.
3 4 5 |
# File 'lib/diy/factory.rb', line 3 def class_name @class_name end |
#library ⇒ Object
Returns the value of attribute library.
3 4 5 |
# File 'lib/diy/factory.rb', line 3 def library @library end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/diy/factory.rb', line 3 def name @name end |
#target ⇒ Object
Returns the value of attribute target.
3 4 5 |
# File 'lib/diy/factory.rb', line 3 def target @target end |