Skip to content

Instantly share code, notes, and snippets.

@aoitaku
Last active December 20, 2015 18:18
Show Gist options
  • Save aoitaku/6174687 to your computer and use it in GitHub Desktop.
Save aoitaku/6174687 to your computer and use it in GitHub Desktop.
temporary `extend'
module Hoge
def hoge
p "hoge"
end
end
block1 = Proc.new {
extend Hoge
hoge
}
block2 = Proc.new {
hoge
}
Class.new.class_eval(&block1) #=>hoge
#block2.call #=>undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment