Skip to content

Instantly share code, notes, and snippets.

@nbryan
Created October 29, 2009 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nbryan/221412 to your computer and use it in GitHub Desktop.
Save nbryan/221412 to your computer and use it in GitHub Desktop.
class Person
def self.section(str, &blk)
self.class_eval(&blk)
end
end
class Joe < Person
def name; "Joe"; end
section "speaking methods" do
def say_hi
"Hi"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment