Skip to content

Instantly share code, notes, and snippets.

@allomov
Created March 29, 2011 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allomov/893262 to your computer and use it in GitHub Desktop.
Save allomov/893262 to your computer and use it in GitHub Desktop.
def Foo(*args, &block)
puts args.inspect
block.call if block
Class.new(Foo)
end
=> nil
class Bar < Foo("Hi There!") {
puts "Surprise!"
}
end
["Hi there!"]
Surprise!
=> nil
http://www.ruby-forum.com/topic/96060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment