Skip to content

Instantly share code, notes, and snippets.

@meagar
Last active June 4, 2020 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meagar/0f8379ec706949594e76f9c91c7d6ec1 to your computer and use it in GitHub Desktop.
Save meagar/0f8379ec706949594e76f9c91c7d6ec1 to your computer and use it in GitHub Desktop.
class Base
def self.friendly_name
"Default Friendly Name"
end
end
class Child1 < Base
end
class Child2 < Base
def self.friendly_name
"A more specific friendly name"
end
end
p Child1.friendly_name # Default Friendly Name
p Child2.friendly_name # A more specific friendly name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment