Class: Choosy::BaseParseResult

Inherits:
Object
  • Object
show all
Defined in:
lib/choosy/parse_result.rb

Direct Known Subclasses

ParseResult, SuperParseResult

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandObject (readonly)

Returns the value of attribute command.



3
4
5
# File 'lib/choosy/parse_result.rb', line 3

def command
  @command
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/choosy/parse_result.rb', line 3

def options
  @options
end

#unparsedObject (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

Returns:

  • (Boolean)


20
21
22
# File 'lib/choosy/parse_result.rb', line 20

def subresult?
  @subresult
end