Class: Mealy::Label

Inherits:
Object
  • Object
show all
Defined in:
lib/mealy/label.rb

Overview

FSM state transition arrow labels. In effect we match the input tokens against the labels to decide which transition to take.

Direct Known Subclasses

AnyLabel

Instance Method Summary collapse

Constructor Details

#initialize(label) ⇒ Label

Returns a new instance of Label.

Parameters:

  • label

    Something that can be tested with input tokens


10
11
12
# File 'lib/mealy/label.rb', line 10

def initialize(label)
  @label = label
end

Instance Method Details

#match?(input) ⇒ Boolean

Parameters:

  • input

    Something that can match label

Returns:

  • (Boolean)

15
16
17
# File 'lib/mealy/label.rb', line 15

def match?(input)
  @label === input
end