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.
7 8 9 10 11 12 |
# File 'lib/choosy/parse_result.rb', line 7 def initialize(command, subresult) @command = command @options = {} @unparsed = [] @subresult = subresult end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
5 6 7 |
# File 'lib/choosy/parse_result.rb', line 5 def command @command end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/choosy/parse_result.rb', line 5 def @options end |
#unparsed ⇒ Object (readonly)
Returns the value of attribute unparsed.
5 6 7 |
# File 'lib/choosy/parse_result.rb', line 5 def unparsed @unparsed end |
Instance Method Details
#[](opt) ⇒ Object
14 15 16 |
# File 'lib/choosy/parse_result.rb', line 14 def [](opt) @options[opt] end |
#[]=(opt, val) ⇒ Object
18 19 20 |
# File 'lib/choosy/parse_result.rb', line 18 def []=(opt, val) @options[opt] = val end |
#subresult? ⇒ Boolean
22 23 24 |
# File 'lib/choosy/parse_result.rb', line 22 def subresult? @subresult end |