[Comment] Re: Iterating over a Hash in Ruby

Yep, cool. Thanks, Tony!
irb(main):043:0> h1.each{|k,v| puts "#{k} ---> #{v}"}
a ---> 1
b ---> 2
c ---> 3
=> {"a"=>1, "b"=>2, "c"=>3}

This reminds me of something else that has been bugging me since I saw it. What does this syntax mean?

def list
  @category_pages, @categories = paginate :category, :per_page => 10, :order_by => 'category'

How can Ruby return two values from the paginate method?!

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge