Class: Deptree::Dependency::Action
- Inherits:
-
Object
- Object
- Deptree::Dependency::Action
- Defined in:
- lib/deptree/dependency/actions.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #execute ⇒ Object
-
#initialize(name, behaviour, context) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(name, behaviour, context) ⇒ Action
Returns a new instance of Action.
28 29 30 |
# File 'lib/deptree/dependency/actions.rb', line 28 def initialize(name, behaviour, context) @name, @behaviour, @context = name, behaviour, context end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
26 27 28 |
# File 'lib/deptree/dependency/actions.rb', line 26 def name @name end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 |
# File 'lib/deptree/dependency/actions.rb', line 36 def ==(other) name == other.name end |
#execute ⇒ Object
32 33 34 |
# File 'lib/deptree/dependency/actions.rb', line 32 def execute @context.instance_eval(&@behaviour) end |