Class: RubstApi::Dependency
- Inherits:
-
Object
- Object
- RubstApi::Dependency
- Defined in:
- lib/rubst_api/dependencies.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#callable ⇒ Object
readonly
Returns the value of attribute callable.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#use_cache ⇒ Object
readonly
Returns the value of attribute use_cache.
Instance Method Summary collapse
-
#initialize(callable, use_cache: true, dependencies: {}) ⇒ Dependency
constructor
A new instance of Dependency.
Constructor Details
#initialize(callable, use_cache: true, dependencies: {}) ⇒ Dependency
Returns a new instance of Dependency.
6 7 8 9 |
# File 'lib/rubst_api/dependencies.rb', line 6 def initialize(callable, use_cache: true, dependencies: {}) raise ArgumentError, "dependency must be callable" unless callable.respond_to?(:call) @callable, @use_cache, @dependencies = callable, use_cache, dependencies end |
Instance Attribute Details
#callable ⇒ Object (readonly)
Returns the value of attribute callable.
5 6 7 |
# File 'lib/rubst_api/dependencies.rb', line 5 def callable @callable end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
5 6 7 |
# File 'lib/rubst_api/dependencies.rb', line 5 def dependencies @dependencies end |
#use_cache ⇒ Object (readonly)
Returns the value of attribute use_cache.
5 6 7 |
# File 'lib/rubst_api/dependencies.rb', line 5 def use_cache @use_cache end |