I do believe this might be a new feature in Ruby 2.0? I’m not sure if
it’s confirmed though.
In the meantime you can kind of fake it using hashes. Ruby is clever
enough to know when to convert an argument list to a hash like so:
def talk(params)
puts “Hello, I am #{params[:name]} and I am #{params[:age]} years
old”
end
talk(:name=>“Bob”,:age=>27)
Farrel
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.