(Follow-up on part 1)
One of the great and powerful things about Ruby is its ability to expressively extract common patterns through metaprogramming. Even the standard library in Ruby provides some good examples. One of my favorites is the generation of getter/setter methods for instance variables, the attr methods:
class Person
attr_reader :name # adds 'name' method (getter)
attr_writer :phone # adds 'phone=' method (setter)
attr_accessor :address # adds both 'address' and 'address='
attr :gender # same as attr_accessor
end
Using the metaprogramming techniques like this, we’re going to clean up a few things in feed_tools.
BarCamp was a blast yesterday. I met some really great and smart people, and my presentation went over very well. I think we’ll have some more people using Radiant in the near future. For those who didn’t get to see my presentation, or want to review what they did see, click below for a 