Class: DIY::FactoryDef

Inherits:
Object
  • Object
show all
Defined in:
lib/diy/factory.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

Returns the value of attribute class_name.



3
4
5
# File 'lib/diy/factory.rb', line 3

def class_name
  @class_name
end

#libraryObject

Returns the value of attribute library.



3
4
5
# File 'lib/diy/factory.rb', line 3

def library
  @library
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/diy/factory.rb', line 3

def name
  @name
end

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/diy/factory.rb', line 3

def target
  @target
end