Class: FunApi::ManagedDependency
- Inherits:
-
Object
- Object
- FunApi::ManagedDependency
- Defined in:
- lib/funapi/dependency_wrapper.rb
Instance Attribute Summary collapse
-
#cleanup_proc ⇒ Object
readonly
Returns the value of attribute cleanup_proc.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #call ⇒ Object
- #cleanup ⇒ Object
-
#initialize(resource, cleanup_proc) ⇒ ManagedDependency
constructor
A new instance of ManagedDependency.
Constructor Details
#initialize(resource, cleanup_proc) ⇒ ManagedDependency
22 23 24 25 |
# File 'lib/funapi/dependency_wrapper.rb', line 22 def initialize(resource, cleanup_proc) @resource = resource @cleanup_proc = cleanup_proc end |
Instance Attribute Details
#cleanup_proc ⇒ Object (readonly)
Returns the value of attribute cleanup_proc.
20 21 22 |
# File 'lib/funapi/dependency_wrapper.rb', line 20 def cleanup_proc @cleanup_proc end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
20 21 22 |
# File 'lib/funapi/dependency_wrapper.rb', line 20 def resource @resource end |
Instance Method Details
#call ⇒ Object
27 28 29 |
# File 'lib/funapi/dependency_wrapper.rb', line 27 def call @resource end |
#cleanup ⇒ Object
31 32 33 |
# File 'lib/funapi/dependency_wrapper.rb', line 31 def cleanup @cleanup_proc&.call end |