Class: Foobara::CommandConnectors::ShCliConnector::InputsParser::Result

Inherits:
Object
  • Object
show all
Defined in:
foobara-sh-cli-connector-0.0.16/src/sh_cli_connector/inputs_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

Returns a new instance of Result.



8
9
10
# File 'foobara-sh-cli-connector-0.0.16/src/sh_cli_connector/inputs_parser.rb', line 8

def initialize
  self.parsed = {}
end

Instance Attribute Details

#current_arrayObject

Returns the value of attribute current_array.



6
7
8
# File 'foobara-sh-cli-connector-0.0.16/src/sh_cli_connector/inputs_parser.rb', line 6

def current_array
  @current_array
end

#parsedObject

Returns the value of attribute parsed.



6
7
8
# File 'foobara-sh-cli-connector-0.0.16/src/sh_cli_connector/inputs_parser.rb', line 6

def parsed
  @parsed
end

#remainderObject

Returns the value of attribute remainder.



6
7
8
# File 'foobara-sh-cli-connector-0.0.16/src/sh_cli_connector/inputs_parser.rb', line 6

def remainder
  @remainder
end

Instance Method Details

#validate!Object



12
13
14
15
16
17
18
# File 'foobara-sh-cli-connector-0.0.16/src/sh_cli_connector/inputs_parser.rb', line 12

def validate!
  unless remainder.empty?
    # TODO: let's invert the order for single command mode: parse inputs first, then global from remainder,
    # and then raise if there's anything left
    raise ParseError, "Unexpected argument: #{remainder.first}"
  end
end