Skip to content

Instantly share code, notes, and snippets.

@markmcspadden
Created January 6, 2012 22:13
Show Gist options
  • Save markmcspadden/1572652 to your computer and use it in GitHub Desktop.
Save markmcspadden/1572652 to your computer and use it in GitHub Desktop.
Playing around with super in module includes with itchy
class Rubyist
def check_me
puts "Rubyist"
end
end
class Chef
end
module Texas
def check_me
puts "Texas"
super if defined?(super)
end
end
module Dallas
include Texas
def check_me
puts "Dallas"
super if defined?(super)
end
end
class Scott < Rubyist
include Dallas
def check_me
puts "Scott"
super
end
end
class Mark < Chef
include Dallas
def check_me
puts "Mark"
super
end
end
Scott.new.check_me
Mark.new.check_me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment