Sha256: efc18117694b0ce0b034532766e0e0429cf56f840bfda4f7edd76a0644188ec3

Contents?: true

Size: 616 Bytes

Versions: 55

Compression:

Stored size: 616 Bytes

Contents

# encoding: utf-8

# Cocking mechanics of a transition. A transition has to be cocked, before
# it can succesfuly +#fire+. (+#fire!+ method disregards cocking.)
# 
module YPetri::Transition::Cocking
  # Is the transition cocked?
  # 
  def cocked?
    @cocked
  end

  # Negation of +#cocked?+ method.
  # 
  def uncocked?
    not cocked?
  end

  # Cocks teh transition -- allows +#fire+ to succeed.
  # 
  def cock
    @cocked = true
  end
  alias :cock! :cock

  # Sets the transition state to uncocked.
  # 
  def uncock
    @cocked = false
  end
  alias :uncock! :uncock
end # class YPetri::Transition::Cocking

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
y_petri-2.4.9 lib/y_petri/transition/cocking.rb
y_petri-2.4.8 lib/y_petri/transition/cocking.rb
y_petri-2.4.6 lib/y_petri/transition/cocking.rb
y_petri-2.4.4 lib/y_petri/transition/cocking.rb
y_petri-2.4.3 lib/y_petri/transition/cocking.rb
y_petri-2.4.2 lib/y_petri/transition/cocking.rb
y_petri-2.4.0 lib/y_petri/transition/cocking.rb
y_petri-2.3.12 lib/y_petri/transition/cocking.rb
y_petri-2.3.11 lib/y_petri/transition/cocking.rb
y_petri-2.3.10 lib/y_petri/transition/cocking.rb
y_petri-2.3.9 lib/y_petri/transition/cocking.rb
y_petri-2.3.8 lib/y_petri/transition/cocking.rb
y_petri-2.3.6 lib/y_petri/transition/cocking.rb
y_petri-2.3.5 lib/y_petri/transition/cocking.rb
y_petri-2.3.4 lib/y_petri/transition/cocking.rb
y_petri-2.3.3 lib/y_petri/transition/cocking.rb
y_petri-2.3.2 lib/y_petri/transition/cocking.rb
y_petri-2.2.4 lib/y_petri/transition/cocking.rb
y_petri-2.2.3 lib/y_petri/transition/cocking.rb
y_petri-2.2.2 lib/y_petri/transition/cocking.rb