# File lib/rhc/commands.rb, line 155 def ==(other) @table == other.instance_variable_get(:@table) end
# File lib/rhc/commands.rb, line 146 def [](meth) k = meth.to_sym value = @table.has_key?(k) ? @table[k] : @defaults[k] value = value.call if value.is_a? Proc value end
# File lib/rhc/commands.rb, line 143 def []=(meth, value) @table[meth.to_sym] = value end
# File lib/rhc/commands.rb, line 152 def __explicit__ @table end
# File lib/rhc/commands.rb, line 164 def __hash__ @defaults.merge(@table) end
# File lib/rhc/commands.rb, line 161 def __replace__(options) @table = __to_hash__(options) end
# File lib/rhc/commands.rb, line 167 def __to_hash__(obj) Options === obj ? obj.__hash__ : obj end
# File lib/rhc/commands.rb, line 158 def default defaults = {} @defaults.merge!(__to_hash__(defaults)) end
# File lib/rhc/commands.rb, line 126 def method_missing meth, *args, &block if meth.to_s =~ /^\w+=$/ raise ArgumentError, "Options does not support #{meth} without a single argument" if args.length != 1 self[meth.to_s.chop] = args.first elsif meth.to_s =~ /^\w+$/ if !@table.has_key?(meth) && !@defaults.has_key?(meth) begin; return super; rescue NoMethodError; nil; end end raise ArgumentError, "Options does not support #{meth} with arguments" if args.length != 0 self[meth] else super end end
Generated with the Darkfish Rdoc Generator 2.