Skip to content

Instantly share code, notes, and snippets.

@Asher-
Created October 10, 2010 04:51
Show Gist options
  • Save Asher-/618968 to your computer and use it in GitHub Desktop.
Save Asher-/618968 to your computer and use it in GitHub Desktop.
class A
def method
puts 'do some stuff'
end
def method_with_same_name_as_in_module
end
end
class B < A
prepend :method
def method
puts 'do some stuff first'
end
prepend 'module-with-method.rb'
end
B.new.method
#=> do some stuff first
#=> do some stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment