Jeremy Durham

Ruby, Rails, and everything in between.

  • BlogThoughts
  • AboutAbout the Author
  • ContactGet in touch

January 22, 2006 22:10
Posted by Jeremy Durham

Returning more than one object

So, apparently I’ve been living under a rock, but no one told me you could return more than one object at a time in Ruby. Take for example:

def return_stuff
  u = User.find :all
  o = Order.find :all
  return [u,o]
end

and this snippet:

u,o = return_stuff

Now, granted, you probably want to use this when dealing with two items that are a bit more, related to each other, but nonetheless, very cool.

No Comments

Posted Under Programming

  • Posts
  • Twitter
  • Flickr
 

DNS-321 + OpenVPN...

Technology

 

There is no Holy ...

Technology

 

Google and Apple:...

Technology

Am I the only one who thinks that the Ruby Motion video only outputs on the left channel? #annoying

follow me on
twitter

125942640_a3dcc3f951_s125942637_c4524c7c88_s125942628_a682f8a639_s122144184_5f2dd86929_s122144182_1b01ded312_s122144181_893a82f1d3_s122144179_70465b00ff_s122102402_21e6174af6_s122102401_f6d9ebff55_s

Categories

  • Technology
  • Programming
  • Family
  • Travel

This site is using the Handgloves WordPress Theme
Designed & Developed by George Wiscombe

Subscribe via RSS