Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# nov@tov ~$ ruby -v
# ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]
module IncludeMe
def say(message: "Hello")
puts "#{message} from IncludeMe"
end
end
module PrependMe
def say(message: "Hello")
puts "#{message} from PrependMe"
super
end
end
class Base
prepend PrependMe
include IncludeMe
def say(message: "Hello")
puts "#{message} from Base"
super
end
end
b = Base.new
b.say message: 'Yeah!'
# =>
# Yeah! from PrependMe
# Hello from Base
# Hello from IncludeMe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.