Class: Fixman::Task
- Inherits:
-
Object
- Object
- Fixman::Task
- Defined in:
- lib/fixman/task.rb
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, condition, command, cleanup) ⇒ Task
constructor
A new instance of Task.
- #run(target) ⇒ Object
Constructor Details
#initialize(name, condition, command, cleanup) ⇒ Task
Returns a new instance of Task.
5 6 7 8 9 10 |
# File 'lib/fixman/task.rb', line 5 def initialize(name, condition, command, cleanup) @name = name @condition = condition @command = command @cleanup = cleanup end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
3 4 5 |
# File 'lib/fixman/task.rb', line 3 def condition @condition end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/fixman/task.rb', line 3 def name @name end |
Instance Method Details
#run(target) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/fixman/task.rb', line 12 def run target success = @command.call(target) @cleanup.call(target) success end |