This post originated from an RSS feed registered with Ruby Buzz
by Bob Hutchison.
Original Post: Nice Ruby Idiom
Feed Title: This used to be fun! ... What happened? | Ruby
Feed URL: https://bobhutchison.wordpress.com/feed/
Feed Description: The Ruby side of my efforts to put the fun back into programming.
Ruby has the ability to reopen a class and continue its definition, like this...
class C
def m1
puts "method one"
end
end
# sometime later, maybe someplace else...
class C
def m2
puts "method two"
end
end
# and now we have both m1 and ...