るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.024秒)
トップページ > クエリ:TOPLEVEL_BINDING[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. toplevel reset
  2. toplevel new
  3. context toplevel
  4. toplevel full_name
  5. toplevel file_stat

ライブラリ

クラス

モジュール

キーワード

検索結果

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

引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行 ごとに交互に表示します。

...ます。

@param bind Binding オブジェクトを指定します。省略した場合は、最
後に実行した XMP#puts、Kernel#xmp の
Binding を使用します。まだ何も実行していない場合は
Object::TOPLEVEL_BINDING を使用します。...