Skip to content

Instantly share code, notes, and snippets.

@skorfmann
Created April 26, 2010 14:44
Show Gist options
  • Save skorfmann/379417 to your computer and use it in GitHub Desktop.
Save skorfmann/379417 to your computer and use it in GitHub Desktop.
class One
def self.inherited(by)
by.instance_eval do
class << self
define_method(:test) do
puts "it works from #{self}"
end
end
end
end
end
class Two < One
end
puts Two.test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment