Class: Foobara::CommandConnectors::ShCliConnector::InputsParser::Result
- Inherits:
-
Object
- Object
- Foobara::CommandConnectors::ShCliConnector::InputsParser::Result
- Defined in:
- foobara-sh-cli-connector-0.0.16/src/sh_cli_connector/inputs_parser.rb
Instance Attribute Summary collapse
-
#current_array ⇒ Object
Returns the value of attribute current_array.
-
#parsed ⇒ Object
Returns the value of attribute parsed.
-
#remainder ⇒ Object
Returns the value of attribute remainder.
Instance Method Summary collapse
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Result
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_array ⇒ Object
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 |
#parsed ⇒ Object
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 |
#remainder ⇒ Object
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 |