以下の内容はhttps://tbpgr.hatenablog.com/entry/20140506/1399346053より取得しました。


Ruby | Kernel | binding

概要

Kernel#binding

詳細

変数・メソッドなどの環境情報を含んだ Binding オブジェクトを 生成して返します。通常、Kernel.#eval の第二引数として使います。

サンプルコード
# encoding: utf-8
require 'pp'

class Hoge
  def hoge
    hige = 'hige!'
    pp binding
    eval "print hige+hege", binding
  end

  def hege
    "hege!"
  end
end

Hoge.new.hoge
出力
#<Binding:0x2946c30>
hige!hege!



以上の内容はhttps://tbpgr.hatenablog.com/entry/20140506/1399346053より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14