るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dh p
  5. rsa p

クラス

キーワード

検索結果

ERB#result(b=TOPLEVEL_BINDING) -> String (203.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"
p
uts erb.result
# test foo
# test bar
//...
...}

@see ERB#result_with_hash...

ERB#run(b=TOPLEVEL_BINDING) -> nil (203.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"
erb
.run
# test foo
# test bar
//}...