Class: Cocina::Instance
- Inherits:
-
Object
- Object
- Cocina::Instance
- Extended by:
- Forwardable
- Defined in:
- lib/cocina/instance.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#runner ⇒ Object
Returns the value of attribute runner.
Instance Method Summary collapse
- #depends(dep) ⇒ Object
- #has_dependency? ⇒ Boolean
-
#initialize(name) ⇒ Instance
constructor
A new instance of Instance.
Constructor Details
#initialize(name) ⇒ Instance
Returns a new instance of Instance.
12 13 14 15 |
# File 'lib/cocina/instance.rb', line 12 def initialize(name) @name = name @dependencies = [] end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
5 6 7 |
# File 'lib/cocina/instance.rb', line 5 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/cocina/instance.rb', line 5 def name @name end |
#runner ⇒ Object
Returns the value of attribute runner.
6 7 8 |
# File 'lib/cocina/instance.rb', line 6 def runner @runner end |
Instance Method Details
#depends(dep) ⇒ Object
17 18 19 |
# File 'lib/cocina/instance.rb', line 17 def depends(dep) @dependencies << dep end |
#has_dependency? ⇒ Boolean
21 22 23 |
# File 'lib/cocina/instance.rb', line 21 def has_dependency? dependencies.empty? ? false : true end |