class Finite::Transition

The transition class. Represents a transition between two states

Attributes

condition[R]
from[R]
to[R]

Public Class Methods

new(opts) click to toggle source

Create a new transition object

@param opts [Hash] the options for a transition. Include :to, :from, and :if

# File lib/finite/transition.rb, line 11
def initialize(opts)
  @from = opts[:from]
  @to = opts[:to]
  @condition = opts[:if]
end

Public Instance Methods

==(other) click to toggle source

Does this transition equal another transition?

@param other [Transition] another transition @return true if they are equal false if not

# File lib/finite/transition.rb, line 21
def ==(other)
  from == other.from and to == other.to and condition == other.condition
end