Skip to content

Instantly share code, notes, and snippets.

@bhenderson
Created April 2, 2009 16:14
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 bhenderson/89270 to your computer and use it in GitHub Desktop.
Save bhenderson/89270 to your computer and use it in GitHub Desktop.
class YMech < WWW::Mechanize
private_class_method :new
def YMech.create
#do some stuff, define a global variable
#
# so my question is, how do I pass a block that I can also then pass to `new`?
# example of how you normally pass a block to new
#a = WWW::Mechanize.new { |agent|
# agent.follow_meta_refresh = true
# }
# so my question is, how do I pass a block that I can also then pass to `new`?
new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment