るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.090秒)
トップページ > クエリ:l[x] > バージョン:2.5.0[x] > クエリ:r[x] > クエリ:u[x] > ライブラリ:erb[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

クラス

モジュール

キーワード

検索結果

ERB::Util.#u(s) -> String (72610.0)

文字列 s を URLエンコードした文字列を返します。

...た文字列を返します(CGI.escapeとほぼ同じです)。

@param s URLエンコードを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%2...

ERB::Util.#url_encode(s) -> String (54910.0)

文字列 s を URLエンコードした文字列を返します。

...た文字列を返します(CGI.escapeとほぼ同じです)。

@param s URLエンコードを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%2...

ERB#result(b=TOPLEVEL_BINDING) -> String (54907.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#result_with_hash(hash) -> String (54907.0)

ERB をハッシュオブジェクトで指定されたローカル変数を持つ 新しいトップレベルバインディングで実行し、結果の文字列を返します。

...
ERB
をハッシュオブジェクトで指定されたローカル変数を持つ
新しいトップレベルバインディングで実行し、結果の文字列を返します。

@param hash ローカル変数名をキーにしたハッシュ

@see ERB#result...

ERB#def_module(methodname=&#39;erb&#39;) -> Module (46507.0)

変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。

...ルを返します。

@param methodname メソッド名

//emlist[例][ruby]{
require 'erb'
filename = 'example.rhtml'
erb
= ERB.new("test1<%= arg1 %>\ntest2<%= arg2 %>\n")
erb
.filename = filename
MyModule = erb.def_module('render(arg1, arg2)')
class MyClass
include MyModule
end
print MyClass.new...

絞り込み条件を変える

ERB::Util (45007.0)

eRubyスクリプトのためのユーティリティを提供するモジュールです。

eRubyスクリプトのためのユーティリティを提供するモジュールです。

ERB#set_eoutvar(compiler, eoutvar = &#39;_erbout&#39;) -> Array (37507.0)

ERBの中でeRubyスクリプトの出力をためていく変数を設定します。

...
ERB
の中でeRubyスクリプトの出力をためていく変数を設定します。

ERB
でeRubyスクリプトの出力をためていく変数を設定するために使用します。
この設定は ERB#new でも行えるため、通常はそちらを使用した方がより容易です。...

ERB#run(b=TOPLEVEL_BINDING) -> nil (36907.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::Util.#html_escape(s) -> String (36607.0)

文字列 s を HTML用にエスケープした文字列を返します。

...照 &amp; &quot; &lt; &gt; にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。

@param s HTMLエスケープを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts html_escape("is a > 0 & a < 10?")
# is a &gt; 0 &amp; a &lt; 10?
//}...

ERB#def_class(superklass=Object, methodname=&#39;erb&#39;) -> Class (28507.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::Util.#h(s) -> String (27307.0)

文字列 s を HTML用にエスケープした文字列を返します。

...照 &amp; &quot; &lt; &gt; にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。

@param s HTMLエスケープを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts html_escape("is a > 0 & a < 10?")
# is a &gt; 0 &amp; a &lt; 10?
//}...

ERB.new(str, safe_level=nil, trim_mode=nil, eoutvar=&#39;_erbout&#39;) -> ERB (10207.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...eRubyスクリプト から ERB オブジェクトを生成して返します。

@param str eRubyスクリプトを表す文字列
@param safe_level eRubyスクリプトが実行されるときのセーフレベル
@param trim_mode 整形の挙動を変更するオプション

@param eoutvar eRuby...
...スクリプトの中で出力をためていく変数の名前を表す文
字列。eRuby スクリプトの中でさらに ERB を使うときに変更
します。通常は指定する必要はありません。

Ruby 2.6.0 から位置引数での safe_level, trim_m...
...3.2 で削除されました。
trim_mode と eoutvar の指定はキーワード引数に移行してください。

//emlist[例][ruby]{
require "erb"

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried...