Last active
August 27, 2019 17:06
-
-
Save irridescentrambler/44eea9faa794f8379aac5eeab826896f 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
module SuperPowers | |
def powers | |
puts "I can run at 80 mph and lift 200 lbs weight" | |
end | |
end | |
class Human | |
def introduce | |
puts "Hi i am a #{self.class.name}" | |
end | |
end | |
class SuperHuman < Human | |
include SuperPowers | |
end | |
# ["simple_method_lookup_demo.rb", 2] | |
puts SuperHuman.new.method(:introduce).source_location.inspect | |
# ["simple_method_lookup_demo", 8] | |
puts SuperHuman.new.method(:powers).source_location.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment