Class: GLI::Options
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- GLI::Options
- 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
-
#[](k) ⇒ Object
Return the value of an attribute.
-
#[]=(k, v) ⇒ Object
Set the value of an attribute.
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 |