Ruby Extensions Project
Posted by MSch Mon, 21 Nov 2005 13:04:00 GMT
After reading about the Ruby Extensions Project in Why’s Hopping Through Pipes and Closures I decided to try it out.
I installed it via gem install -r extensions and started reading the documentation.
class Circle
attr_reader :radius, :location, :area
autoinit(:radius, :location) do
@area = Math::PI * @radius ** 2
end
end
Circle::new(1,2,3)New with 0.6.0 comes require_relative, which requires a file relative to the file containing the statement.
Finally my_object.in? some_other_object provides a pythonesque way of expressing some_other_object.include?(my_object).
Of course there are many many more features but these are the ones that seem particularly useful to me
