Skip to content

Instantly share code, notes, and snippets.

@mscottford
Created February 23, 2012 16:12
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 mscottford/1893475 to your computer and use it in GitHub Desktop.
Save mscottford/1893475 to your computer and use it in GitHub Desktop.
class Base
def alpha
:alpha
end
end
class Child < Base
def beta
:beta
end
end
Base.class_eval do
def gamma
:gamma
end
end
a = Base.new
puts a.alpha
puts a.gamma
b = Child.new
puts b.alpha
puts b.beta
puts b.gamma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment