Skip to content

Instantly share code, notes, and snippets.

Created August 5, 2013 19:12
Show Gist options
  • Save anonymous/6158560 to your computer and use it in GitHub Desktop.
Save anonymous/6158560 to your computer and use it in GitHub Desktop.
class_name_test.rb
class A
def self.inherited(other)
puts other.name
end
end
class B < A
end
# Prints 'B'
C = Class.new(A) do
def self.name
'C'
end
end
# How do I inherited to see 'C'?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment