Class: Mealy::Executer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mealy/runner.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.

An object on which #run behaves like Mealy#execute. The internal state is tracked by this instance, the user state is in Mealy.

Direct Known Subclasses

Runner

Instance Method Summary collapse

Constructor Details

#initialize(mealy) ⇒ Executer

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.

Returns a new instance of Executer.

Parameters:

  • mealy (Mealy)

    mealy instance


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

def initialize(mealy)
  @mealy = mealy
  @state = nil
end

Instance Method Details

#run(enum) ⇒ Object

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.

same as calling Mealy#execute


16
17
18
19
20
21
22
# File 'lib/mealy/runner.rb', line 16

def run(enum)
  start

  enum.each { |c| run_for_token(c) }

  finish
end