Class: CmdExecutable::Parser
- Inherits:
-
Object
- Object
- CmdExecutable::Parser
- Defined in:
- lib/cmd_executable/parser.rb
Overview
Parser for CmdExecutable
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(raw) ⇒ Parser
constructor
A new instance of Parser.
- #validate? ⇒ Boolean
Constructor Details
#initialize(raw) ⇒ Parser
Returns a new instance of Parser.
34 35 36 37 |
# File 'lib/cmd_executable/parser.rb', line 34 def initialize(raw) @raw = raw @raw.freeze end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
32 33 34 |
# File 'lib/cmd_executable/parser.rb', line 32 def raw @raw end |
Instance Method Details
#command ⇒ Object
46 47 48 49 |
# File 'lib/cmd_executable/parser.rb', line 46 def command parse if @command.nil? @command end |
#validate? ⇒ Boolean
39 40 41 42 43 44 |
# File 'lib/cmd_executable/parser.rb', line 39 def validate? !@raw.nil? && command_class_validate? && !@raw.empty? && !include_invalid_char? end |