On 10/15/2010 9:18 AM, Paul Bergstrom wrote:
> What if I would like to pass several values, with some set with a 
> default value if not declared?

module Abc
  def self.test(opts = {})
    default_opts = {
      :color => 'yellow',
      :size => 'small'
    }
    opts = default_opts.merge(opts)

    puts "color = #{opts[:color]}, size = #{opts[:size]}"
  end
end

Abc.test
# => color = yellow, size = small
Abc.test(:color => 'red')
# => color = red, size = small
Abc.test(:size => 'large')
# => color = yellow, size = large
Abc.test(:color => 'blue', :size => 'humongous')
# => color = blue, size = humongous

-Jeremy