Class: Quill::Factory
- Inherits:
-
Object
- Object
- Quill::Factory
- Defined in:
- lib/quill/factory.rb
Instance Attribute Summary collapse
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
Instance Method Summary collapse
- #call(container) ⇒ Object
-
#initialize(klass, arguments = {}) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(klass, arguments = {}) ⇒ Factory
Returns a new instance of Factory.
5 6 7 8 9 10 |
# File 'lib/quill/factory.rb', line 5 def initialize(klass, arguments={}) @feature = arguments.fetch(:feature) @dependencies = arguments[:dependencies] || [] @curried = arguments[:curried] @klass = klass end |
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
3 4 5 |
# File 'lib/quill/factory.rb', line 3 def feature @feature end |
Instance Method Details
#call(container) ⇒ Object
12 13 14 |
# File 'lib/quill/factory.rb', line 12 def call(container) curried? ? construct_curried_proc(container) : construct_instance(container) end |