13 Mar '12, 11pm

The Magic Pens of Ruby /ht @mattly

I’ve recently found myself describing single objects yielded by iterators as “magic pens.” Though it may sound more psychodelic than technical, it’s actually proven to be a good way to explain these objects and give people a feel for why an iterator would only yield one object in the first place. I don’t mean cases where you iterate through a collection that happens to have only one element. I mean methods that, by design, yield one and only one object, every time they’re run. The very word “iteration” evokes collections, and it’s not surprising that I’ve seen puzzlement over iterator constructs like this one: create_table do |t| t.column :first_name, :string t.column :last_name, :string end The create_table method is being supplied with a block, so it’s an iterator. (Ask any method: iterator? and it will tell you true if you’ve given it a block, even if it never yields to...

Full article: http://dablog.rubypal.com/2007/2/18/the-magic-pens-of-ruby

Tweets

Why's (poignant) guide to ruby has the best programming soundtrack ever! #studiosounds #ruby

Why's (poignant) guide to ruby has the best pro...

mislav.uniqpath.com 14 Mar '12, 4am

why's (poignant) guide to ruby Performed slapdash by The Thirsty Cups Siphon the MP3s below. Place them on the wooden appl...

link: Ruby on Rails Guides: Ruby On Rails Secur...

edgeguides.rubyonrails.org 14 Mar '12, 9pm

The threats against web applications include user account hijacking, bypass of access control, reading or modifying sensit...

Ruby Platform Options Throwdown:

engineyard.com 21 Mar '12, 3am

Engine Yard, Inc. Log in Login to Engine Yard Cloud Login to Orchestra PHP Cloud Products Engine Yard Cloud Engine Yard Ma...

Ruby on Rails developer: 180 from Central Afric...

workingwithrails.com 15 Mar '12, 2am

Working With Rails - sponsored and created by DSC Disclaimer: This is a publicly accessible database. The views and opinio...

58% off Miracle Magic Slimming Belt by The Skin Professionals. For more info check us out at

58% off Miracle Magic Slimming Belt by The Skin...

streetdeal.sg 13 Mar '12, 9am

The Skin Professionals are a group of aesthetic experts from France, Switzerland and USA that formulates premium skincare ...

Suggest @arunagw on how to make the best use of...

rubyflow.com 13 Mar '12, 7am

Suggestions for content on "rubyonrails.io" Posted by arunagw on March 11, 2012 — 4 comments I just brought the domain "ru...

I love Ruby because

rubyflow.com 12 Mar '12, 8pm

I love Ruby because ... Posted by rtdp on March 12, 2012 — 0 comments I really love ruby language, and so do many folks us...

integrating PHP and Ruby On Rails - Ruby Forum

ruby-forum.com 24 Mar '12, 7am

check out if they have a REST-api and access this API using one of the numerous tools available like ActiveResource or Htt...

Ruby interface to OpenDNS's PhishTank API:

rubygems.org 14 Mar '12, 12am

phishtank 0.1.1 Ruby interface to OpenDNS's PhishTank API install gem install phishtank Download Subscribe Stats Authors E...

Did not realize that so many people had used my...

rubylearning.com 25 Mar '12, 1am

By Satish Talim RubyLearning.com is a thorough collection of Ruby Study Notes for those who are new to the Ruby programmin...

String#insert - Destructive to the Original Str...

apidock.com 18 Mar '12, 5am

It’s very easy. First we begin our placeholder with “%”, then we specify a zero (0) to signify padding with zeros. If we o...