るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.016秒)

別のキーワード

  1. _builtin hash
  2. hash []
  3. dbm to_hash
  4. matrix hash
  5. _builtin to_hash

クラス

キーワード

検索結果

ERB#result_with_hash(hash) -> String (18631.0)

ERB をハッシュオブジェクトで指定されたローカル変数を持つ 新しいトップレベルバインディングで実行し、結果の文字列を返します。

...
ERB
をハッシュオブジェクトで指定されたローカル変数を持つ
新しいトップレベルバインディングで実行し、結果の文字列を返します。

@param hash ローカル変数名をキーにしたハッシュ

@see ERB#result...

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