Class: Console1984::CommandValidator::ParsedCommand
- Inherits:
-
Object
- Object
- Console1984::CommandValidator::ParsedCommand
- Includes:
- Freezeable
- Defined in:
- lib/console1984/command_validator/parsed_command.rb
Overview
Parses a command string and exposes different constructs to be used by validations.
Internally, it uses the parser gem to perform the parsing.
Instance Attribute Summary collapse
-
#raw_command ⇒ Object
readonly
Returns the value of attribute raw_command.
Instance Method Summary collapse
-
#initialize(raw_command) ⇒ ParsedCommand
constructor
A new instance of ParsedCommand.
Methods included from Freezeable
Constructor Details
#initialize(raw_command) ⇒ ParsedCommand
Returns a new instance of ParsedCommand.
11 12 13 |
# File 'lib/console1984/command_validator/parsed_command.rb', line 11 def initialize(raw_command) @raw_command = Array(raw_command).join("\n") end |
Instance Attribute Details
#raw_command ⇒ Object (readonly)
Returns the value of attribute raw_command.
7 8 9 |
# File 'lib/console1984/command_validator/parsed_command.rb', line 7 def raw_command @raw_command end |