This post originated from an RSS feed registered with Ruby Buzz
by James Tucker.
Original Post: Super Blank Slates
Feed Title: ragged blog » Ruby
Feed URL: http://blog.ra66i.org/catagories/informatics/programming/ruby/feed/
Feed Description: blog of raggisms and random musings, by raggi™
(by category: ruby)
So there’s BlankSlate, and today tmm1 was doing something where he was delegating to Array, but wanted to actually have Array in the ancestor chain (for Class#===), so I came up with this:
def BS(superclass = nil, name = :BlankSlate)
klass = eval("
class #{name} #{" < #{superclass}" if superclass}
[...]