Class: RArg::ParseResult

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

Overview

return of parsing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base) ⇒ ParseResult

Returns a new instance of ParseResult.



99
100
101
# File 'lib/rarg.rb', line 99

def initialize(base)
	@base = base
end

Instance Attribute Details

#baseObject (readonly) Also known as: arguments

Returns the value of attribute base.



96
97
98
# File 'lib/rarg.rb', line 96

def base
  @base
end

Instance Method Details

#[](name) ⇒ Object



103
104
105
106
107
108
109
# File 'lib/rarg.rb', line 103

def [](name)
	if @base.include?(name) then
		@base[name]
	else
		raise Error, "argument name '#{name}' is not defined"
	end
end