Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class SomeParent
def foo
puts "Parenting is fun."
end
end
module SomeModule
def foo
puts "Module time."
end
end
class SomeChild < SomeParent
alias :parent_foo :foo
include SomeModule
end
s = SomeChild.new
s.foo # => "Module time."
s.parent_foo # => "Parenting is fun."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment