Class: Barn::Builders::Hash
- Inherits:
-
Object
- Object
- Barn::Builders::Hash
- Defined in:
- lib/barn/builders/hash.rb
Instance Method Summary collapse
-
#call(env) ⇒ Object
‘env` is a hash with: :name - symbol name of the factory :options - optional params passed to `Barn.define` :args - parameters passed to the block of`Barn.build`.
-
#initialize(app) ⇒ Hash
constructor
A new instance of Hash.
Constructor Details
#initialize(app) ⇒ Hash
Returns a new instance of Hash.
4 5 6 |
# File 'lib/barn/builders/hash.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
‘env` is a hash with:
:name - symbol name of the factory
:options - optional params passed to `Barn.define`
:args - parameters passed to the block of`Barn.build`
12 13 14 15 |
# File 'lib/barn/builders/hash.rb', line 12 def call(env) object = @app.call(env) object.merge(env[:args]) end |