Class: Methodical::SimpleActionItem
- Inherits:
-
ActionItem
- Object
- ActionItem
- Methodical::SimpleActionItem
- Extended by:
- Forwardable
- Defined in:
- lib/methodical/simple_action_item.rb
Instance Attribute Summary
Attributes inherited from ActionItem
#disposition, #error, #ignored, #title, #walkthrough
Attributes included from Executable
Instance Method Summary collapse
- #==(other) ⇒ Object
- #call(baton, step) ⇒ Object
-
#initialize(title, callable = nil, &block) ⇒ SimpleActionItem
constructor
A new instance of SimpleActionItem.
Methods inherited from ActionItem
#abort!, #checkpoint!, #continue?, #decisive?, #fail!, #finish!, #human_status, #ignored?, #inspect, #relevant?, #skip!, #succeed!, #sufficient!, #synopsis, #to_s, #update!
Methods included from Executable
#catch_disposition, #execute!, #raise_on_error?
Constructor Details
#initialize(title, callable = nil, &block) ⇒ SimpleActionItem
Returns a new instance of SimpleActionItem.
7 8 9 10 11 12 13 |
# File 'lib/methodical/simple_action_item.rb', line 7 def initialize(title, callable=nil, &block) unless(!!callable ^ !!block) raise ArgumentError, "Either a callable or a block must be provided" end @block = callable || block super(title) end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/methodical/simple_action_item.rb', line 19 def ==(other) self.block.eql?(other.block) end |
#call(baton, step) ⇒ Object
15 16 17 |
# File 'lib/methodical/simple_action_item.rb', line 15 def call(baton, step) @block.call(baton, step) end |