Sha256: 6c703f51058cadaa9ebb9e308c0575b7eeb797472944cba1cca71897d7da1ee2

Contents?: true

Size: 544 Bytes

Versions: 4

Compression:

Stored size: 544 Bytes

Contents

# encoding: utf-8

module FiniteMachine
  # Stand in for lack of matching transition.
  #
  # Used internally by {EventsChain}
  #
  # @api private
  class UndefinedTransition
    include Threadable

    # Initialize an undefined transition
    #
    # @api private
    def initialize(name)
      self.name = name
    end

    def to_state(from)
      from
    end

    def ==(other)
      other.is_a?(UndefinedTransition) && name == other.name
    end

    protected

    attr_threadsafe :name

  end # UndefinedTransition
end # FiniteMachine

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
finite_machine-0.11.3 lib/finite_machine/undefined_transition.rb
finite_machine-0.11.2 lib/finite_machine/undefined_transition.rb
finite_machine-0.11.1 lib/finite_machine/undefined_transition.rb
finite_machine-0.11.0 lib/finite_machine/undefined_transition.rb