4件ヒット
[1-4件を表示]
(0.154秒)
ライブラリ
- erb (4)
キーワード
-
def
_ class (1) - result (1)
- run (1)
-
set
_ eoutvar (1)
検索結果
先頭4件
-
ERB
# def _ class(superklass=Object , methodname=& # 39;erb& # 39;) -> Class (19207.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
...mlist[例][ruby]{
require 'erb'
class MyClass_
def initialize(arg1, arg2)
@arg1 = arg1; @arg2 = arg2
end
end
filename = 'example.rhtml' # @arg1 と @arg2 が使われている example.rhtml
erb = ERB.new(File.read(filename))
erb.filename = filename
MyClass = erb.def_class(MyClass_, 'rend... -
ERB
# result(b=TOPLEVEL _ BINDING) -> String (18607.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 (607.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
//}... -
ERB
# set _ eoutvar(compiler , eoutvar = & # 39; _ erbout& # 39;) -> Array (607.0) -
ERBの中でeRubyスクリプトの出力をためていく変数を設定します。
...
ERBの中でeRubyスクリプトの出力をためていく変数を設定します。
ERBでeRubyスクリプトの出力をためていく変数を設定するために使用します。
この設定は ERB#new でも行えるため、通常はそちらを使用した方がより容易です。...