Class: Barn::Factory
- Inherits:
-
Object
- Object
- Barn::Factory
- Defined in:
- lib/barn/factory.rb
Overview
maybe Proc already defines __FILENAME__ and __LINENUMBER__
Instance Attribute Summary collapse
-
#filename ⇒ Object
help with debugging where something was defined.
-
#line ⇒ Object
help with debugging where something was defined.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#call(env) ⇒ Object
Returns built object.
-
#initialize(name, options = {}, &blk) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(name, options = {}, &blk) ⇒ Factory
Returns a new instance of Factory.
9 10 11 12 13 |
# File 'lib/barn/factory.rb', line 9 def initialize(name, = {}, &blk) @name = name = @blk = blk end |
Instance Attribute Details
#filename ⇒ Object
help with debugging where something was defined
5 6 7 |
# File 'lib/barn/factory.rb', line 5 def filename @filename end |
#line ⇒ Object
help with debugging where something was defined
5 6 7 |
# File 'lib/barn/factory.rb', line 5 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/barn/factory.rb', line 7 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/barn/factory.rb', line 7 def end |
Instance Method Details
#call(env) ⇒ Object
Returns built object
16 17 18 |
# File 'lib/barn/factory.rb', line 16 def call(env) @blk.call(env) end |