-
-
Save KraevRoot/3e2a40274a6ff3c1b18a0920b8f31c17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
class ASS | |
class << self | |
def create_method(name, &block) | |
puts self.inspect | |
self.send(:define_method, name, &block) | |
end | |
def test(name, &block) | |
puts self.inspect | |
create_method(name, &block) | |
end | |
end | |
test("xxx") { puts "YEEE"} | |
test "bbb" do |a,b| | |
puts a + b == 1 | |
puts "YEEE" | |
end | |
end | |
a = ASS.new | |
binding.pry | |
a.xxx | |
a.bbb(3,6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment