るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.094秒)
トップページ > クエリ:-[x] > クエリ:I[x] > クエリ:>[x] > クエリ:test[x] > ライブラリ:erb[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. ipaddr to_i

クラス

キーワード

検索結果

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

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

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

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

//emlist[例][ruby]{
require 'erb'
erb
= ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test
1 = "foo"
test
2 = "bar"
puts erb.result
# test foo
# test bar
//...
...}

@see ERB#result_with_hash...

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

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

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

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

//emlist[例][ruby]{
require 'erb'
erb
= ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test
1 = "foo"
test
2 = "bar"
erb
.run
# test foo
# test bar
//}...

ERB#src -> String (320.0)

変換した Ruby スクリプトを取得します。

...

//emlist[例][ruby]{
require 'erb'
erb
= ERB.new("test1<%= @arg1%>\ntest2<%= @arg2%>\n\n")
puts erb.src

# #coding:UTF-8
# _erbout = +''; _erbout.<< "test1".freeze; _erbout.<<(( @arg1).to_s); _erbout.<< "\ntest2".freeze
# ; _erbout.<<(( @arg2).to_s); _erbout.<< "\n\n".freeze
#
# ; _erbout
//}...