Class: Gts::CommandParser
- Inherits:
-
Object
- Object
- Gts::CommandParser
- Defined in:
- lib/gts/command_parser.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #iniialize ⇒ Object
-
#parse(str) ⇒ Object
zatial vieme parsovat iba primitivne veci status last_data known_imeis uptime.
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/gts/command_parser.rb', line 5 def args @args end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
5 6 7 |
# File 'lib/gts/command_parser.rb', line 5 def command @command end |
Instance Method Details
#iniialize ⇒ Object
7 8 9 10 |
# File 'lib/gts/command_parser.rb', line 7 def iniialize @command = nil @args = [] end |
#parse(str) ⇒ Object
zatial vieme parsovat iba primitivne veci status last_data known_imeis uptime
17 18 19 20 21 |
# File 'lib/gts/command_parser.rb', line 17 def parse(str) command, *@args = str.split(/\s+/) @command = command.to_s.to_sym [@command, @args] end |