Class: Console1984::CommandValidator::ParsedCommand

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Freezeable

freeze_all, included

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_commandObject (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