Skip to content

Instantly share code, notes, and snippets.

@KraevRoot
Last active October 22, 2018 09: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 KraevRoot/3e2a40274a6ff3c1b18a0920b8f31c17 to your computer and use it in GitHub Desktop.
Save KraevRoot/3e2a40274a6ff3c1b18a0920b8f31c17 to your computer and use it in GitHub Desktop.
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