Skip to content

Instantly share code, notes, and snippets.

@closer
Created November 13, 2015 17:09
Show Gist options
  • Save closer/263ea7c99fb95517f030 to your computer and use it in GitHub Desktop.
Save closer/263ea7c99fb95517f030 to your computer and use it in GitHub Desktop.
class Hoge
def test
test1 test2 test3
end
def test3
self.class.send :define_method, :test2 do |a|
self.class.send :define_method, :test1 do |a|
a
end
end
end
end
p Hoge.new.test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment