-
-
Save joshuaclayton/221443 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 Person | |
def self.region(str, &blk) | |
self.class_eval(&blk) | |
end | |
end | |
class Joe < Person | |
def name; "Joe"; end | |
region "speaking" do | |
def say_hi | |
"Hi" | |
end | |
def say_hi_to(someone) | |
return say_hi if someone.blank? | |
"#{say_hi}, #{someone}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment