Skip to content

Instantly share code, notes, and snippets.

@itstommymorgan
Created February 25, 2010 16:18
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 itstommymorgan/314681 to your computer and use it in GitHub Desktop.
Save itstommymorgan/314681 to your computer and use it in GitHub Desktop.
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