JQuery = Class.new {
  define_singleton_method(:click) { |name, &blk|
    blk.(name);
  }
}

alias :alert :puts

method(def _ _
  _.click("Charlie", &->name{ 
    alert "Hello, " + name + "!!"
    });
end).(JQuery)

# >> Hello, Charlie!!

意味不明。



blog comments powered by Disqus
ruby_pack8

100円〜で好評発売中!
M'ELBORNE BOOKS