るりまサーチ

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

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

キーワード

検索結果

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

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

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

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

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

@see ERB#result_with_hash...

ERB#run(b=TOPLEVEL_BINDING) -> nil (6308.0)

ERB を b の binding で実行し、結果を標準出力へ印字します。

...
ERB
を b の binding で実行し、結果を標準出力へ印字します。

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

//emlist[例][ruby]{
r
equire 'erb'
erb
= ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
t
est1 = "foo"
t
est2 = "bar"
erb
.run
# test foo
# test bar
//}...