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.



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

#commandObject (readonly)

Returns the value of attribute command.



5
6
7
# File 'lib/choosy/parse_result.rb', line 5

def command
  @command
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/choosy/parse_result.rb', line 5

def options
  @options
end

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

Returns:

  • (Boolean)


22
23
24
# File 'lib/choosy/parse_result.rb', line 22

def subresult?
  @subresult
end