3件ヒット
[1-3件を表示]
(0.074秒)
検索結果
先頭3件
-
ERB
# result(b=TOPLEVEL _ BINDING) -> String (307.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
# run(b=TOPLEVEL _ BINDING) -> nil (307.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
//} -
Kernel
# xmp(exps , bind = nil) -> XMP (22.0) -
引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行 ごとに交互に表示します。
引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行
ごとに交互に表示します。
@param exps 評価するRuby のソースコードを文字列で指定します。
@param bind Binding オブジェクトを指定します。省略した場合は、最
後に実行した XMP#puts、Kernel#xmp の
Binding を使用します。まだ何も実行していない場合は
Object::TOPLEVEL_BINDING を使用します。