Sha256: c5c6f4d0511d8f34b2396393b6f1fc15b7078a758b472508c767c48577a457fd
Contents?: true
Size: 770 Bytes
Versions: 8
Compression:
Stored size: 770 Bytes
Contents
module RProgram class OptionList < Hash # # Creates a new OptionList object. # # @param [Hash{Symbol => String}] options # The options to start with. # def initialize(options={}) super(options) end protected # # Provides transparent access to the options within the option list. # # @example # opt_list = OptionList.new(:name => 'test') # opt_list.name # # => "test" # 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 end end
Version data entries
8 entries across 8 versions & 1 rubygems