Sha256: 74b8a80eb1f9d94b59f6fffa1ec6b5cda4da866755183a4fd908b2deb20e4931
Contents?: true
Size: 1 KB
Versions: 17
Compression:
Stored size: 1 KB
Contents
module Aio::Parse require "aio/core/parse/parser_machine/parent_state" require "aio/core/parse/parser_machine/no_device_state" require "aio/core/parse/parser_machine/has_device_state" require "aio/core/parse/parser_machine/full_state" class ParserMachine # 保存状态机的状态 attr_reader :state # device_manager attr_reader :device_manager def initialize(device_manager) @device_manager = device_manager @no_device_state = Aio::Parse::NoDeviceState.new(self) @has_device_state = Aio::Parse::HasDeviceState.new(self) @full_state = Aio::Parse::FullState.new(self) @state = @no_device_state end def get_device(opts) @state.get_device(opts) end def get_full(opts) @state.get_full(opts) end # 状态的切换 def to_no_device_state @state = @no_device_state end def to_has_device_state @state = @has_device_state end def to_full_state @state = @full_state end end end
Version data entries
17 entries across 17 versions & 1 rubygems