Created
October 10, 2010 04:51
-
-
Save Asher-/618968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment