るりまサーチ (Ruby 2.1.0)

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

別のキーワード

  1. object toplevel_binding
  2. toplevel new
  3. toplevel reset
  4. toplevel full_name
  5. toplevel file_stat

ライブラリ

クラス

モジュール

キーワード

検索結果

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
//}

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 を使用します。