Module: YPetri::Transition::Cocking
- Defined in:
- lib/y_petri/transition/cocking.rb
Overview
Cocking mechanics of a transition. A transition has to be cocked, before it can succesfuly #fire
. (#fire!
method disregards cocking.)
Instance Method Summary collapse
-
#cock ⇒ Object
(also: #cock!)
Cocks teh transition – allows
#fire
to succeed. -
#cocked? ⇒ Boolean
Is the transition cocked?.
-
#uncock ⇒ Object
(also: #uncock!)
Sets the transition state to uncocked.
-
#uncocked? ⇒ Boolean
Negation of
#cocked?
method.
Instance Method Details
#cock ⇒ Object Also known as: cock!
Cocks teh transition – allows #fire
to succeed.
21 22 23 |
# File 'lib/y_petri/transition/cocking.rb', line 21 def cock @cocked = true end |
#cocked? ⇒ Boolean
Is the transition cocked?
9 10 11 |
# File 'lib/y_petri/transition/cocking.rb', line 9 def cocked? @cocked end |
#uncock ⇒ Object Also known as: uncock!
Sets the transition state to uncocked.
28 29 30 |
# File 'lib/y_petri/transition/cocking.rb', line 28 def uncock @cocked = false end |
#uncocked? ⇒ Boolean
Negation of #cocked?
method.
15 16 17 |
# File 'lib/y_petri/transition/cocking.rb', line 15 def uncocked? not cocked? end |