Class: ArgsParser::Options

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Options

Returns a new instance of Options.



3
4
5
# File 'lib/argsparser/options.rb', line 3

def initialize(options)
  @s = options
end

Instance Method Details

#[](a) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/argsparser/options.rb', line 7

def [](a)
  if @s[a.to_sym]
    if @s[a.to_sym][:arg] == :none
      return true
    else
      return @s[a.to_sym][:arg]
    end
  else
    return nil
  end
end