るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.027秒)
トップページ > バージョン:2.1.0[x] > クエリ:Binding[x] > クエリ:top[x] > クエリ:result[x]

別のキーワード

  1. _builtin binding
  2. binding eval
  3. binding local_variable_set
  4. binding local_variable_get
  5. proc binding

ライブラリ

クラス

検索結果

ERB#result(b=TOPLEVEL_BINDING) -> String (54991.0)

ERB を b の binding で実行し、結果の文字列を返します。

ERB を b の binding で実行し、結果の文字列を返します。

@param b eRubyスクリプトが実行されるときのbinding

//emlist[例][ruby]{
require 'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test1 = "foo"
test2 = "bar"
puts erb.result
# test foo
# test bar
//}