48件ヒット
[1-48件を表示]
(0.153秒)
別のキーワード
ライブラリ
- erb (48)
キーワード
-
def
_ class (12) - result (12)
- run (12)
-
set
_ eoutvar (12)
検索結果
先頭4件
-
ERB
# def _ class(superklass=Object , methodname=& # 39;erb& # 39;) -> Class (102.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
...@param superklass 無名クラスのスーパークラス
@param methodname メソッド名
//emlist[例][ruby]{
require 'erb'
class MyClass_
def initialize(arg1, arg2)
@arg1 = arg1; @arg2 = arg2
end
end
filename = 'example.rhtml' # @arg1 と @arg2 が使われている example.rhtm......l
erb = ERB.new(File.read(filename))
erb.filename = filename
MyClass = erb.def_class(MyClass_, 'render()')
print MyClass.new('foo', 123).render()
# => test1foo
# test2123
//}... -
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
//......}
@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
//}... -
ERB
# set _ eoutvar(compiler , eoutvar = & # 39; _ erbout& # 39;) -> Array (102.0) -
ERBの中でeRubyスクリプトの出力をためていく変数を設定します。
...
ERBの中でeRubyスクリプトの出力をためていく変数を設定します。
ERBでeRubyスクリプトの出力をためていく変数を設定するために使用します。
この設定は ERB#new でも行えるため、通常はそちらを使用した方がより容易です。......本メソッドを使用するためには、引数にて指定する eRuby コンパイラを事前に生成しておく必要があります。
@param compiler eRubyコンパイラ
@param eoutvar eRubyスクリプトの中で出力をためていく変数...