種類
- インスタンスメソッド (120)
- 特異メソッド (44)
- モジュール関数 (22)
- ライブラリ (11)
- 文書 (9)
クラス
-
CSV
:: Table (22) - Hash (42)
- OpenStruct (12)
-
REXML
:: DocType (11) -
REXML
:: Element (11) -
URI
:: FTP (22) -
URI
:: LDAP (22) - UnboundMethod (11)
モジュール
キーワード
-
add
_ element (11) - build (44)
- entities (11)
- format (11)
-
irb
/ completion (11) - owner (11)
- sprintf (11)
-
to
_ csv (11) -
to
_ h (12) -
to
_ json (11) -
transform
_ keys! (10) -
transform
_ values (16) -
transform
_ values! (16) - メソッド呼び出し(super・ブロック付き・yield) (9)
検索結果
先頭5件
-
Hash
# transform _ values {|value| . . . } -> Hash (36444.0) -
すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。 キーは変化しません。
...ator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values(&:to_s) #=> { a: "1", b: "2", c: "3" }
h.transform_values.with_index {|v, i| "#{v}.#{i}" }......#=> { a: "1.0", b: "2.1", c: "3.2" }
//}
@see Hash#transform_values!......#=> { a: "1.0", b: "2.1", c: "3.2" }
//}
@see Hash#transform_values!
@see Hash#transform_keys
@see Hash#transform_keys!... -
Hash
# transform _ values! {|value| . . . } -> self (36242.0) -
すべての値に対してブロックを呼び出した結果でハッシュの値を変更します。 キーは変化しません。
...m_values! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values! {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values!(&:to_s)......#=> { a: "2", b: "5", c: "10" }
h.transform_values!.with_index {|v, i| "#{v}.#{i}" }
#=> { a: "2.0", b: "5.1", c: "10.2" }
//}
@see Hash#transform_values......#=> { a: "2", b: "5", c: "10" }
h.transform_values!.with_index {|v, i| "#{v}.#{i}" }
#=> { a: "2.0", b: "5.1", c: "10.2" }
//}
@see Hash#transform_values
@see Hash#transform_keys
@see Hash#transform_keys!... -
Hash
# transform _ values -> Enumerator (36144.0) -
すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。 キーは変化しません。
...ator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values(&:to_s) #=> { a: "1", b: "2", c: "3" }
h.transform_values.with_index {|v, i| "#{v}.#{i}" }......#=> { a: "1.0", b: "2.1", c: "3.2" }
//}
@see Hash#transform_values!
@see Hash#transform_keys
@see Hash#transform_keys!... -
Hash
# transform _ values! -> Enumerator (36142.0) -
すべての値に対してブロックを呼び出した結果でハッシュの値を変更します。 キーは変化しません。
...m_values! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values! {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values!(&:to_s)......#=> { a: "2", b: "5", c: "10" }
h.transform_values!.with_index {|v, i| "#{v}.#{i}" }
#=> { a: "2.0", b: "5.1", c: "10.2" }
//}
@see Hash#transform_values
@see Hash#transform_keys
@see Hash#transform_keys!... -
Hash
# transform _ values -> Enumerator (36120.0) -
すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。 キーは変化しません。
...ator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values(&:to_s) #=> { a: "1", b: "2", c: "3" }
h.transform_values.with_index {|v, i| "#{v}.#{i}" }......#=> { a: "1.0", b: "2.1", c: "3.2" }
//}
@see Hash#transform_values!... -
Hash
# transform _ values! -> Enumerator (36118.0) -
すべての値に対してブロックを呼び出した結果でハッシュの値を変更します。 キーは変化しません。
...m_values! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values! {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values!(&:to_s)......#=> { a: "2", b: "5", c: "10" }
h.transform_values!.with_index {|v, i| "#{v}.#{i}" }
#=> { a: "2.0", b: "5.1", c: "10.2" }
//}
@see Hash#transform_values... -
Hash
# transform _ keys!(hash) -> self (30356.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ru......k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys!(&:to_sym) # => {:a=>1, :b=>2, :c=>3}
h.transform_keys!(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
h.transform_keys!.with_index {|k, i| "#{k}.#{i}" }
# => {"a.0"=>1, "b.1"=>2, "c.2"=>3}
//}
@see Hash#......transform_keys
@see Hash#transform_values
@see Hash#transform_values!... -
Hash
# transform _ keys! {|key| . . . } -> self (30156.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_keys! {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys!(&:to_sym) # =......> {:a=>1, :b=>2, :c=>3}
h.transform_keys!.with_index {|k, i| "#{k}.#{i}" }
# => {"a.0"=>1, "b.1"=>2, "c.2"=>3}
//}
@see Hash#transform_keys
@see Hash#transform_values
@see Hash#transform_values!......@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ru......k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys!(&:to_sym) # => {:a=>1, :b=>2, :c=>3}
h.transform_keys!(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
h.transform_keys!.with_index {|k, i| "#{k}.#{i}" }
# => {"a.0"=>1, "b.1"=>2, "c.2"=>3}
//}
@see Hash#......transform_keys
@see Hash#transform_values
@see Hash#transform_values!... -
CSV
:: Table # to _ s(options = Hash . new) -> String (18305.0) -
CSV の文字列に変換して返します。
...ションに :write_headers =>
false を指定するとヘッダを出力しません。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_headers: false) # => "1,2,3\n"
//}... -
URI
:: LDAP . build(hash) -> URI :: LDAP (9420.0) -
引数で与えられた URI 構成要素から URI::LDAP オブジェクトを生成します。 引数の正当性を検査します。
...要素から URI::LDAP オブジェクトを生成します。
引数の正当性を検査します。
@param ary 構成要素を表す配列を与えます。要素は次の順です。
//emlist{
[:host, :port, :dn, :attributes, :scope, :filter, :extensions]
//}
@param hash 構成要素を......のキーは
//emlist{
:host, :port, :dn, :attributes, :scope, :filter, :extensions
//}
のいずれかです。
@raise URI::InvalidComponentError 各要素が適合しない場合に発生します。
例:
require 'uri'
p URI::LDAP.build(["example.com", "1", "/a", "b......", "c", "d", "e=f"]).to_s
#=> "ldap://example.com:1/a?b?c?d?e=f"... -
URI
:: LDAP . build(ary) -> URI :: LDAP (9220.0) -
引数で与えられた URI 構成要素から URI::LDAP オブジェクトを生成します。 引数の正当性を検査します。
...要素から URI::LDAP オブジェクトを生成します。
引数の正当性を検査します。
@param ary 構成要素を表す配列を与えます。要素は次の順です。
//emlist{
[:host, :port, :dn, :attributes, :scope, :filter, :extensions]
//}
@param hash 構成要素を......のキーは
//emlist{
:host, :port, :dn, :attributes, :scope, :filter, :extensions
//}
のいずれかです。
@raise URI::InvalidComponentError 各要素が適合しない場合に発生します。
例:
require 'uri'
p URI::LDAP.build(["example.com", "1", "/a", "b......", "c", "d", "e=f"]).to_s
#=> "ldap://example.com:1/a?b?c?d?e=f"... -
REXML
:: Element # add _ element(element , attrs = nil) -> Element (6330.0) -
子要素を追加します。
...子要素を追加します。
element として追加する要素を指定します。
REXML::Element オブジェクトもしくは文字列を指定します。
element として REXML::Element オブジェクトを指定した場合、それが追加されます。
文字列を指定した場......という Hash を渡すと、
追加する要素の属性を指定できます。
子要素の最後に追加されます。
返り値は追加された要素です。
@param element 追加する要素
@param attrs 追加する要素に設定する属性
//emlist[][ruby]{
require 'rexml/documen......ML::Document.new('<a/>')
el = doc.root.add_element 'my-tag' # => <my-tag/>
doc.root.to_s # => "<a><my-tag/></a>"
el = doc.root.add_element 'my-tag', {'attr1'=>'val1', 'attr2'=>'val2'}
# => <my-tag attr1='val1' attr2='val2'/>
doc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/></a>"
el... -
URI
:: FTP . build(hash) -> URI :: FTP (6320.0) -
引数で与えられた URI 構成要素から URI::FTP オブジェクトを生成します。 引数の正当性を検査します。
...ld([nil, "www.example.com", 10020, "/path", 'a'])
#=> #<URI::FTP:0x201c4f9c URL:ftp://www.example.com:10020/path;type=a>
p URI::FTP.build({:host => "www.example.com", :path => "/path", :typecode => 'a'})
#=> #<URI::FTP:0x201bd9cc URL:ftp://www.example.com/path;type=a>
p URI::FTP.buil......d([nil, 'example.com', nil, '/foo', 'i']).to_s
#=> 'ftp://example.com/%2Ffoo;type=i'
@param ary 構成要素を表す文字列の配列を与えます。要素は
//emlist{
[userinfo, host, port, path, typecode]
//}
の順です。typecode は、"a"、"i" あるいは "d" です......データタイプがFTPのプロトコルで ASCII と IMAGE と呼ばれていたためです。
@param hash 構成要素を表すハッシュを与えます。ハッシュのキーは
//emlist{
:scheme, :userinfo, :host, :port, :path, :typecode
//}
のいずれかです。ハッシ... -
URI
:: FTP . build(ary) -> URI :: FTP (6120.0) -
引数で与えられた URI 構成要素から URI::FTP オブジェクトを生成します。 引数の正当性を検査します。
...ld([nil, "www.example.com", 10020, "/path", 'a'])
#=> #<URI::FTP:0x201c4f9c URL:ftp://www.example.com:10020/path;type=a>
p URI::FTP.build({:host => "www.example.com", :path => "/path", :typecode => 'a'})
#=> #<URI::FTP:0x201bd9cc URL:ftp://www.example.com/path;type=a>
p URI::FTP.buil......d([nil, 'example.com', nil, '/foo', 'i']).to_s
#=> 'ftp://example.com/%2Ffoo;type=i'
@param ary 構成要素を表す文字列の配列を与えます。要素は
//emlist{
[userinfo, host, port, path, typecode]
//}
の順です。typecode は、"a"、"i" あるいは "d" です......データタイプがFTPのプロトコルで ASCII と IMAGE と呼ばれていたためです。
@param hash 構成要素を表すハッシュを与えます。ハッシュのキーは
//emlist{
:scheme, :userinfo, :host, :port, :path, :typecode
//}
のいずれかです。ハッシ...