1470件ヒット
[1-100件を表示]
(0.119秒)
ライブラリ
- ビルトイン (63)
-
cgi
/ core (12) - csv (3)
- date (4)
- dbm (96)
- gdbm (96)
- json (24)
-
net
/ http (72) - openssl (552)
- ostruct (34)
-
rexml
/ document (60) -
rinda
/ tuplespace (24) -
rubygems
/ specification (12) - sdbm (108)
- tsort (58)
-
win32
/ registry (216) -
yaml
/ dbm (36)
クラス
-
CSV
:: Row (3) - DBM (96)
- Data (3)
- Date (2)
- DateTime (2)
- GDBM (96)
-
Gem
:: Specification (12) - Hash (40)
-
JSON
:: State (24) - MatchData (2)
-
OpenSSL
:: Cipher (12) -
OpenSSL
:: PKCS7 (12) -
OpenSSL
:: PKCS7 :: RecipientInfo (12) -
OpenSSL
:: PKey :: DH (84) -
OpenSSL
:: PKey :: DSA (120) -
OpenSSL
:: PKey :: EC (72) -
OpenSSL
:: PKey :: EC :: Group (60) -
OpenSSL
:: PKey :: PKey (12) -
OpenSSL
:: PKey :: RSA (168) - OpenStruct (34)
-
REXML
:: AttlistDecl (12) -
REXML
:: Element (48) -
Rinda
:: TupleEntry (24) - SDBM (108)
- Struct (16)
- Time (2)
-
Win32
:: Registry (192) -
Win32
:: Registry :: PredefinedKey (24) -
YAML
:: DBM (36)
モジュール
-
CGI
:: QueryExtension (12) -
Net
:: HTTPHeader (72) - TSort (58)
キーワード
- [] (72)
-
add
_ attribute (24) -
check
_ key (12) - class (12)
- close (12)
-
compute
_ key (12) - create (12)
-
curve
_ name (12) -
deconstruct
_ keys (20) - decrypt (12)
- delete (36)
-
delete
_ attribute (12) -
delete
_ key (12) -
descriptor
_ length (12) -
dh
_ compute _ key (12) - dig (20)
- disposition (12)
-
dsa
_ sign _ asn1 (12) -
each
_ element _ with _ attribute (12) -
each
_ key (12) -
each
_ pair (24) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
enc
_ key (12) - export (60)
- fetch (60)
-
get
_ fields (12) - hkey (12)
- indent (12)
- indent= (12)
- index (48)
- info (12)
- keyname (12)
- keys (60)
-
max
_ key _ length (12) -
max
_ value _ length (12) -
max
_ value _ name _ length (12) -
num
_ keys (12) -
num
_ values (12) - open (12)
- params (36)
-
private
_ decrypt (12) -
private
_ encrypt (12) - public? (12)
-
public
_ decrypt (12) -
public
_ encrypt (12) -
random
_ key (12) - reject (12)
- seed (12)
- select (24)
- sign (12)
-
signing
_ key (12) - store (36)
-
strongly
_ connected _ components (12) - syssign (12)
-
to
_ a (24) -
to
_ der (60) -
to
_ pem (84) -
to
_ s (60) -
to
_ text (60) -
transform
_ keys (20) -
transform
_ keys! (20) -
values
_ at (36) - wtime (12)
検索結果
先頭5件
-
DBM
# key(value) -> String | nil (18202.0) -
与えられた値に対応するキーを返します。
与えられた値に対応するキーを返します。
対応する要素が存在しない時には nil を返します。
値に対応するキーが複数ある場合は最初に見つかったキーを返します。
@param value キーを探したい値を指定します。 -
GDBM
# key(value) -> String | nil (18202.0) -
与えられた値に対応するキーを返します。
与えられた値に対応するキーを返します。
対応する要素が存在しない時には nil を返します。
値に対応するキーが複数ある場合は最初に見つかったキーを返します。
@param value キーを探したい値を指定します。 -
SDBM
# key(value) -> String | nil (18202.0) -
与えられた値に対応するキーを返します。
与えられた値に対応するキーを返します。
対応する要素が存在しない時には nil を返します。
値に対応するキーが複数ある場合は最初に見つかったキーを返します。
@param value キーを探したい値を指定します。 -
YAML
:: DBM # key(value) -> String | nil (18202.0) -
value を持つ要素のキーを返します。
value を持つ要素のキーを返します。
対応するキーが見つからなかった場合は nil を返します。
@param value 検索したい値を指定します。YAML 形式に変換できるオブジェク
トが指定できます。 -
Struct
# deconstruct _ keys(array _ of _ names) -> Hash (15201.0) -
self のメンバの名前と値の組を Hash で返します。
...omer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
h = joe.deconstruct_keys([:zip, :address])
h # => {:zip=>12345, :address=>"123 Maple, Anytown NC"}
# 引数が nil の場合は全てのメンバを返します。
h = joe.deconstruct_keys(nil)......:address=>"123 Maple, Anytown NC", :zip=>12345}
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/patter... -
Hash
# transform _ keys {|key| . . . } -> Hash (12302.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...3 }
h.transform_keys {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys(&:to_s) # => {"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!......//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(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
h.transform_keys(&:to_s) # => {"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 (12302.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...urn transform_keys! は常に 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!......# => {: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
:: Row # deconstruct _ keys(keys) -> Hash (12301.0) -
パターンマッチに使用するヘッダの名前と値の Hash を返します。
...が文字列かつ Hash パターン でパターンマッチしたい場合はキーをシンボルに変換する必要があります。
@param keys パターンマッチに使用するヘッダの名前の配列を指定します。nil の場合は全てをパターンマッチに使用しま... -
Hash
# transform _ keys -> Enumerator (12202.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...3 }
h.transform_keys {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys(&:to_s) # => {"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!......//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(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
h.transform_keys(&:to_s) # => {"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! -> Enumerator (12202.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...urn transform_keys! は常に 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!......# => {: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!(hash) -> self (12202.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...urn transform_keys! は常に 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!(......# => {: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(hash) -> Hash (12202.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...//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(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
h.transform_keys(&:to_s) # => {"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!... -
Data
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (12201.0) -
self のメンバの名前と値の組を Hash で返します。
...//emlist[例][ruby]{
Measure = Data.define(:amount, :unit)
distance = Measure.new(10, 'km')
distance.deconstruct_keys(nil) # => {:amount=>10, :unit=>"km"}
distance.deconstruct_keys([:amount]) # => {:amount=>10}
//}
このメソッドは以下のようにパターンマッチで利用され......mlist[例][ruby]{
Measure = Data.define(:amount, :unit)
distance = Measure.new(10, 'km')
case distance
in amount:, unit: 'km' # 裏側で #deconstruct_keys を呼ぶ
puts "It is #{amount} kilometers away"
else
puts "Don't know how to handle it"
end
# "It is 10 kilometers away" が表示され...