Class: Injectable::Dependency
- Inherits:
-
Struct
- Object
- Struct
- Injectable::Dependency
- Defined in:
- lib/injectable/dependency.rb
Overview
Initialize a dependency based on the options or the block passed
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#call ⇒ Object
Returns the value of attribute call.
-
#class ⇒ Object
Returns the value of attribute class.
-
#depends_on ⇒ Object
Returns the value of attribute depends_on.
-
#name ⇒ Object
Returns the value of attribute name.
-
#with ⇒ Object
Returns the value of attribute with.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
3 4 5 |
# File 'lib/injectable/dependency.rb', line 3 def block @block end |
#call ⇒ Object
Returns the value of attribute call
3 4 5 |
# File 'lib/injectable/dependency.rb', line 3 def call @call end |
#class ⇒ Object
Returns the value of attribute class
3 4 5 |
# File 'lib/injectable/dependency.rb', line 3 def class @class end |
#depends_on ⇒ Object
Returns the value of attribute depends_on
3 4 5 |
# File 'lib/injectable/dependency.rb', line 3 def depends_on @depends_on end |
#name ⇒ Object
Returns the value of attribute name
3 4 5 |
# File 'lib/injectable/dependency.rb', line 3 def name @name end |
#with ⇒ Object
Returns the value of attribute with
3 4 5 |
# File 'lib/injectable/dependency.rb', line 3 def with @with end |
Instance Method Details
#instance(args: [], namespace: nil) ⇒ Object
4 5 6 7 |
# File 'lib/injectable/dependency.rb', line 4 def instance(args: [], namespace: nil) args = wrap_args(args) wrap_call build_instance(args, namespace: namespace) end |