Class: Choosy::BaseParseResult
- Inherits:
-
Object
- Object
- Choosy::BaseParseResult
- Defined in:
- lib/choosy/parse_result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#unparsed ⇒ Object
readonly
Returns the value of attribute unparsed.
Instance Method Summary collapse
- #[](opt) ⇒ Object
- #[]=(opt, val) ⇒ Object
-
#initialize(command, subresult) ⇒ BaseParseResult
constructor
A new instance of BaseParseResult.
- #subresult? ⇒ Boolean
Constructor Details
#initialize(command, subresult) ⇒ BaseParseResult
Returns a new instance of BaseParseResult.
5 6 7 8 9 10 |
# File 'lib/choosy/parse_result.rb', line 5 def initialize(command, subresult) @command = command @options = {} @unparsed = [] @subresult = subresult end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/choosy/parse_result.rb', line 3 def command @command end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/choosy/parse_result.rb', line 3 def @options end |
#unparsed ⇒ Object (readonly)
Returns the value of attribute unparsed.
3 4 5 |
# File 'lib/choosy/parse_result.rb', line 3 def unparsed @unparsed end |
Instance Method Details
#[](opt) ⇒ Object
12 13 14 |
# File 'lib/choosy/parse_result.rb', line 12 def [](opt) @options[opt] end |
#[]=(opt, val) ⇒ Object
16 17 18 |
# File 'lib/choosy/parse_result.rb', line 16 def []=(opt, val) @options[opt] = val end |
#subresult? ⇒ Boolean
20 21 22 |
# File 'lib/choosy/parse_result.rb', line 20 def subresult? @subresult end |