Sha256: 21b31dca8d4c4bb995189cb9ba912982d9045f552c20410b7c217f405284c3d8

Contents?: true

Size: 589 Bytes

Versions: 4

Compression:

Stored size: 589 Bytes

Contents

# encoding: utf-8

module FiniteMachine
  # A class representing a callback transition event
  class TransitionEvent

    attr_accessor :from

    attr_accessor :to

    attr_accessor :name

    # Build a transition event
    #
    # @param [FiniteMachine::Transition] transition
    #
    # @return [self]
    #
    # @api private
    def self.build(transition, *data)
      instance = new
      instance.name = transition.name
      instance.from = transition.from_state
      instance.to   = transition.to_state(*data)
      instance
    end
  end # TransitionEvent
end # FiniteMachine

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
finite_machine-0.9.1 lib/finite_machine/transition_event.rb
finite_machine-0.9.0 lib/finite_machine/transition_event.rb
finite_machine-0.8.1 lib/finite_machine/transition_event.rb
finite_machine-0.8.0 lib/finite_machine/transition_event.rb