{"published":"2016-10-02 00:00:00","blog_title":"Secret Garden(Instrumental)","author_name":"osyo-manga","categories":["Ruby"],"author_url":"https://blog.hatena.ne.jp/osyo-manga/","provider_url":"https://hatena.blog","type":"rich","blog_url":"https://secret-garden.hatenablog.com/","description":"Binding#local_variable_get \u3067\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002 def func a, b add = a + b # \u3053\u306e\u30e1\u30bd\u30c3\u30c9\u5185\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u8fd4\u3059 binding end context = func 1, 2 # #local_variable_get \u3067\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306e\u5909\u6570\u3092\u53d6\u5f97\u3059\u308b p context.local_variable_get(:a) # => 1 p context.local_variable_get(:b) # => 2 # \u3082\u3057\u304f\u306f #eval \u3092\u7d4c\u7531\u3057\u3066\u3082\u3088\u3044 p context.eval(\"add\") # => 3","height":"190","provider_name":"Hatena Blog","title":"Ruby \u306e binding \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b","image_url":null,"width":"100%","url":"https://secret-garden.hatenablog.com/entry/2016/10/02/000000","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2016%2F10%2F02%2F000000\" title=\"Ruby \u306e binding \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b - Secret Garden(Instrumental)\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0"}