るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. integer >
  4. complex >
  5. module >

ライブラリ

クラス

検索結果

ERB#result(b=TOPLEVEL_BINDING) -> String (54940.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
//}

@see ERB#result_with_hash

ERB.new(str, safe_level=NOT_GIVEN, trim_mode=NOT_GIVEN, eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: &#39;_erbout&#39;) -> ERB (676.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...by スクリプトの中でさらに ERB を使うときに変更
します。通常は指定する必要はありません。

Ruby 2.6.0 から位置引数での safe_level, trim_mode, eoutvar の指定は非推奨です。
Ruby 3.2 で削除されました。
trim_mode と eoutvar...