Class: GLI::Options

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

Overview

Subclass of OpenStruct that provides hash-like methods for #[] and #[]=. Note that is is not a Hash.

Instance Method Summary collapse

Instance Method Details

#[](k) ⇒ Object

Return the value of an attribute



8
9
10
# File 'lib/gli/options.rb', line 8

def[](k)
  @table[k.to_sym]
end

#[]=(k, v) ⇒ Object

Set the value of an attribute



13
14
15
# File 'lib/gli/options.rb', line 13

def[]=(k, v)
  @table[k.to_sym] = v
end