Class: Aio::Parse::HasDeviceState
- Inherits:
-
ParentState
show all
- Defined in:
- lib/aio/core/parse/parser_machine/has_device_state.rb
Instance Method Summary
collapse
Methods inherited from ParentState
#device_manager, #initialize
Instance Method Details
#check_full(opts = {}) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/aio/core/parse/parser_machine/has_device_state.rb', line 22
def check_full(opts={})
device_name = opts[:device_name]
device_klass = self.device_manager.devices[device_name]
org_cmd = opts[:cmd]
org_context = opts[:context]
org_cmd_reg = Aio::Base::Toolkit::Regexp.to_reg(org_cmd)
device_klass.cmds_context.each_pair do |cmd, context|
if org_cmd_reg.match(cmd)
if ! context.empty?
return true
end
end
end
return false
end
|
#get_device(opts) ⇒ Object
4
5
6
|
# File 'lib/aio/core/parse/parser_machine/has_device_state.rb', line 4
def get_device(opts)
self.device_manager.add_device(opts)
end
|
#get_full(opts) ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'lib/aio/core/parse/parser_machine/has_device_state.rb', line 8
def get_full(opts)
if ! check_full(opts)
no_full
elsif
@machine.to_full_state
end
end
|
#no_full ⇒ Object
18
19
|
# File 'lib/aio/core/parse/parser_machine/has_device_state.rb', line 18
def no_full
end
|