Class: FiniteMachine::TransitionEvent Private

Inherits:
Object
  • Object
show all
Defined in:
lib/finite_machine/transition_event.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A class representing a callback transition event

Used internally by Observer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_name, from, to) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Build a transition event

Parameters:

  • event_name (String)
  • from (String)
  • to (String)


40
41
42
43
44
45
# File 'lib/finite_machine/transition_event.rb', line 40

def initialize(event_name, from, to)
  @name = event_name
  @from = from
  @to   = to
  freeze
end

Instance Attribute Details

#fromObject (readonly)

This event from state name

Returns:

  • (Object)


17
18
19
# File 'lib/finite_machine/transition_event.rb', line 17

def from
  @from
end

#nameObject (readonly)

This event name



29
30
31
# File 'lib/finite_machine/transition_event.rb', line 29

def name
  @name
end

#toObject (readonly)

This event to state name

Returns:

  • (Object)


24
25
26
# File 'lib/finite_machine/transition_event.rb', line 24

def to
  @to
end