37件ヒット
[1-37件を表示]
(0.120秒)
種類
- モジュール関数 (11)
- 特異メソッド (11)
- インスタンスメソッド (11)
- 文書 (4)
クラス
- ERB (22)
モジュール
- ObjectSpace (11)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) -
count
_ tdata _ objects (11) - new (11)
検索結果
先頭5件
- ERB
# result(b=TOPLEVEL _ BINDING) -> String - ERB
. new(str , safe _ level=NOT _ GIVEN , trim _ mode=NOT _ GIVEN , eoutvar=NOT _ GIVEN , trim _ mode: nil , eoutvar: & # 39; _ erbout& # 39;) -> ERB - ObjectSpace
. # count _ tdata _ objects(result _ hash = nil) -> Hash - ERB
. new(str , safe _ level=nil , trim _ mode=nil , eoutvar=& # 39; _ erbout& # 39;) -> ERB - ERB
. new(str , trim _ mode: nil , eoutvar: & # 39; _ erbout& # 39;) -> ERB
-
ERB
# result(b=TOPLEVEL _ BINDING) -> String (18536.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
. new(str , safe _ level=NOT _ GIVEN , trim _ mode=NOT _ GIVEN , eoutvar=NOT _ GIVEN , trim _ mode: nil , eoutvar: & # 39; _ erbout& # 39;) -> ERB (318.0) -
eRubyスクリプト から ERB オブジェクトを生成して返します。
...。
@param str eRubyスクリプトを表す文字列
@param safe_level eRubyスクリプトが実行されるときのセーフレベル
@param trim_mode 整形の挙動を変更するオプション
@param eoutvar eRubyスクリプトの中で出力をためていく変数の名前を表す文......{ :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",
:cost => 9.95 }
attr_reader :product, :price
def initialize( product = "", price = "" )
@product = product
@price = price
end
def build
b = binding
# create......and run templates, filling member data variables
ERB.new(<<~'END_PRODUCT', eoutvar: "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END_PRODUCT
ERB.new(<<~'END_PRICE', eoutvar: "@price").result b
<%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
<%=... -
ObjectSpace
. # count _ tdata _ objects(result _ hash = nil) -> Hash (225.0) -
T_DATA の種類ごとにオブジェクトの数を格納したハッシュを返します。
... result_hash 戻り値のためのハッシュを指定します。省略した場合は新
しくハッシュを作成します。result_hash の内容は上書き
されます。プローブ効果を避けるために使用します。
@raise TypeError result......向けのものです。
//emlist[例][ruby]{
ObjectSpace.count_tdata_objects
# => {RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
# :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99,
# ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
# Random=>1, ARGF.......class=>1, Data=>1, :autoload=>3, Time=>2}
//}
現在のバージョンでは、戻り値のキーはクラスオブジェクトかシンボルのオブ
ジェクトです。
普通の参照可能なオブジェクトの場合、キーはクラスオブジェクトです。それ
以外の内部的... -
ERB
. new(str , safe _ level=nil , trim _ mode=nil , eoutvar=& # 39; _ erbout& # 39;) -> ERB (218.0) -
eRubyスクリプト から ERB オブジェクトを生成して返します。
...。
@param str eRubyスクリプトを表す文字列
@param safe_level eRubyスクリプトが実行されるときのセーフレベル
@param trim_mode 整形の挙動を変更するオプション
@param eoutvar eRubyスクリプトの中で出力をためていく変数の名前を表す文......{ :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",
:cost => 9.95 }
attr_reader :product, :price
def initialize( product = "", price = "" )
@product = product
@price = price
end
def build
b = binding
# create......and run templates, filling member data variables
ERB.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), 0, "", "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END_PRODUCT
ERB.new(<<-'END_PRICE'.gsub(/^\s+/, ""), 0, "", "@price").result b
<%= PRODUCT[:name] %> -- <... -
ERB
. new(str , trim _ mode: nil , eoutvar: & # 39; _ erbout& # 39;) -> ERB (118.0) -
eRubyスクリプト から ERB オブジェクトを生成して返します。
...eRubyスクリプト から ERB オブジェクトを生成して返します。
@param str eRubyスクリプトを表す文字列
@param trim_mode 整形の挙動を変更するオプション
@param eoutvar eRubyスクリプトの中で出力をためていく変数の名前を表す文......{ :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",
:cost => 9.95 }
attr_reader :product, :price
def initialize( product = "", price = "" )
@product = product
@price = price
end
def build
b = binding
# create......and run templates, filling member data variables
ERB.new(<<~'END_PRODUCT', eoutvar: "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END_PRODUCT
ERB.new(<<~'END_PRICE', eoutvar: "@price").result b
<%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
<%=... -
NEWS for Ruby 3
. 0 . 0 (30.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting......single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leadin......ake_while
* Array#uniq
* Array#*
* Can be sliced with Enumerator::ArithmeticSequence
//emlist[][ruby]{
dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1", "data2", "data3"]
//}
* Binding
* Binding#eval...