background preloader

Ruby

Facebook Twitter

Ruby on Rails Tutorial: Learn Rails by Example | Ruby on Rails 3 Tutorial book and screencasts | by Michael Hartl. Ruby Quiz.

Innig.net/software/ruby/closures-in-ruby.rb

MetaProg Techniques. Updated: Scott Labounty wondered how the trace example could work and since a typical metaprogramming technique is writing before- and after-methods, I have added a small version of this.Updated: Fixed two typos, found by Stephen Viles I have been thinking much about Metaprogramming lately. I have come to the conclusion that I would like to see more examples and explanations of these techniques. For good or bad, metaprogramming has entered the Ruby community as the standard way of accomplishing various tasks, and to compress code. Since I couldn't find any good resources of this kind, I will start the ball running by writing about some common Ruby techniques. These tips are probably most useful for programmers that come to Ruby from another language or haven't experienced the joy of Ruby Metaprogramming yet. 1.

Many ways of manipulating single objects are based on manipulations on the singleton class and having this available will make metaprogramming easier. 2. 3. 4. Will emit this XML:

Conferences