Class: RProgram::OptionList
- Inherits:
-
Hash
- Object
- Hash
- RProgram::OptionList
- Defined in:
- lib/rprogram/option_list.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ OptionList
constructor
Creates a new OptionList object.
-
#method_missing(sym, *args, &block) ⇒ Object
protected
Provides transparent access to the options within the option list.
Constructor Details
#initialize(options = {}) ⇒ OptionList
Creates a new OptionList object.
10 11 12 |
# File 'lib/rprogram/option_list.rb', line 10 def initialize(={}) super() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object (protected)
Provides transparent access to the options within the option list.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rprogram/option_list.rb', line 24 def method_missing(sym,*args,&block) name = sym.to_s unless block if (name =~ /=$/ && args.length == 1) return self[name.chop.to_sym] = args.first elsif args.empty? return self[sym] end end return super(sym,*args,&block) end |