{"published":"2006-03-02 00:00:01","version":"1.0","title":"Object#method","author_name":"rubyco","width":"100%","type":"rich","blog_url":"https://rubyco.hatenadiary.org/","author_url":"https://blog.hatena.ne.jp/rubyco/","provider_name":"Hatena Blog","description":"String#to_sym\u3067\u6587\u5b57\u5217\u304b\u3089\u30b7\u30f3\u30dc\u30eb\u304c\u5f97\u3089\u308c\u3001Object#method\u3067\u30b7\u30f3\u30dc\u30eb\u304b\u3089\u30e1\u30bd\u30c3\u30c9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u5f97\u3089\u308c\u307e\u3059\u3002 \u3053\u308c\u3092\u5229\u7528\u3059\u308b\u3068\u3001\u30e1\u30bd\u30c3\u30c9\u540d\u304b\u3089\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u3092\u69cb\u6210\u3059\u308b\u30e1\u30bd\u30c3\u30c9(\u4e0b\u8a18\u306eapply)\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 to_sym\u306fintern\u3068\u540c\u3058\u3067\u3059\u306d\u3002 def hello(a) puts \"Hello, #{a}!\" end def bye(a, b) puts \"Bye, #{a} and #{b}!\" end def apply(name, *args) method(name.to_sym).call(*args) end apply(\"hello\", \"A\u2026","provider_url":"https://hatena.blog","blog_title":"rubyco\uff08\u308b\u3073\u3053\uff09\u306e\u65e5\u8a18","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Frubyco.hatenadiary.org%2Fentry%2F20060302%2Fmethod\" title=\"Object#method - rubyco\uff08\u308b\u3073\u3053\uff09\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":[],"url":"https://rubyco.hatenadiary.org/entry/20060302/method","image_url":null,"height":"190"}