種類
- インスタンスメソッド (466)
- 定数 (252)
- 特異メソッド (47)
- 文書 (41)
ライブラリ
クラス
モジュール
オブジェクト
- ENV (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) -
HKEY
_ CLASSES _ ROOT (12) -
HKEY
_ CURRENT _ CONFIG (12) -
HKEY
_ CURRENT _ USER (12) -
HKEY
_ DYN _ DATA (12) -
HKEY
_ LOCAL _ MACHINE (12) -
HKEY
_ PERFORMANCE _ DATA (12) -
HKEY
_ PERFORMANCE _ NLSTEXT (12) -
HKEY
_ PERFORMANCE _ TEXT (12) -
HKEY
_ USERS (12) -
KEY
_ ALL _ ACCESS (12) -
KEY
_ CREATE _ LINK (12) -
KEY
_ CREATE _ SUB _ KEY (12) -
KEY
_ ENUMERATE _ SUB _ KEYS (12) -
KEY
_ EXECUTE (12) -
KEY
_ NOTIFY (12) -
KEY
_ QUERY _ VALUE (12) -
KEY
_ READ (12) -
KEY
_ SET _ VALUE (12) -
KEY
_ WRITE (12) -
NEWS for Ruby 3
. 0 . 0 (5) -
STANDARD
_ RIGHTS _ READ (12) -
STANDARD
_ RIGHTS _ WRITE (12) - [] (24)
- converters (12)
-
deconstruct
_ keys (20) -
descriptor
_ length (12) - except (8)
-
header
_ converters (12) - info (12)
-
keys
_ with _ inspector (12) -
max
_ key _ length (12) -
max
_ value _ length (12) -
max
_ value _ name _ length (12) -
named
_ captures (2) -
num
_ keys (12) -
num
_ values (12) - replace (12)
- roots (12)
-
ruby 1
. 6 feature (12) - search (12)
- select (24)
- slice (15)
- sort (12)
- thread (12)
-
to
_ a (12) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (16) -
transform
_ values! (16) -
uid
_ search (12) -
uid
_ sort (12) -
uid
_ thread (12) - update (12)
- values (12)
-
values
_ at (60) - wtime (12)
- パターンマッチ (12)
検索結果
先頭5件
-
Win32
:: Registry # keys (18117.0) -
@todo
...@todo... -
Hash
# keys -> [object] (18113.0) -
全キーの配列を返します。
...全キーの配列を返します。
//emlist[例][ruby]{
h1 = { "a" => 100, 2 => ["some"], :c => "c" }
p h1.keys #=> ["a", 2, :c]
//}
@see Hash#values,Hash#to_a... -
CSV
:: Row # deconstruct _ keys(keys) -> Hash (6220.0) -
パターンマッチに使用するヘッダの名前と値の Hash を返します。
...名が文字列かつ Hash パターン でパターンマッチしたい場合はキーをシンボルに変換する必要があります。
@param keys パターンマッチに使用するヘッダの名前の配列を指定します。nil の場合は全てをパターンマッチに使用し....... }
puts "all 2 or more"
in { header1: ...2, header2: 2.., header3: 2.. }
puts "first column is less than 2, and rest columns are 2 or more"
end
#=> "first column is less than 2, and rest columns are 2 or more" が出力される
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Hash
# transform _ keys! -> Enumerator (6169.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...した結果でハッシュのキーを変更します。
値は変化しません。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返します。
ブロックが与えられなかった......mlist[例][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!(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 (6169.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...した結果でハッシュのキーを変更します。
値は変化しません。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返します。
ブロックが与えられなかった......mlist[例][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!(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 (6169.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...した結果でハッシュのキーを変更します。
値は変化しません。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返します。
ブロックが与えられなかった......mlist[例][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!(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 -> Enumerator (6157.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
//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| . . . } -> Hash (6157.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
//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(hash) -> Hash (6157.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
//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 (6156.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...値は変化しません。
@return 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!... -
Hash
# transform _ keys! {|key| . . . } -> self (6156.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...値は変化しません。
@return 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!... -
Hash
# transform _ keys -> Enumerator (6144.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...orm_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 _ keys {|key| . . . } -> Hash (6144.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...orm_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... -
Data
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (6131.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}
//}
このメソッドは以下のようにパターンマッチで利用され......struct_keys を呼ぶ
puts "It is #{amount} kilometers away"
else
puts "Don't know how to handle it"
end
# "It is 10 kilometers away" が表示される
# 以下のようにも書ける
case distance
in Measure(amount:, unit: 'km')
puts "It is #{amount} kilometers away"
# ...
end
//}
@param......ます。
[注意] 本メソッドの記述は Data のサブクラスのインスタンスに対して呼び
出す事を想定しています。Data.define は Data のサブクラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
MatchData
# deconstruct _ keys(array _ of _ names) -> Hash (6131.0) -
引数で指定された名前の名前付きキャプチャを Hash で返します。
...です。
@param array_of_names 名前付きキャプチャの名前の配列を指定します。nil の場合は全ての名前付きキャプチャを意味します。
//emlist[例][ruby]{
m = /(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})/.match("18:37:22")
m.deconstruct_keys([:hours, :......=> "37"}
m.deconstruct_keys(nil) # => {:hours => "18", :minutes => "37", :seconds => "22"}
# 名前付きキャプチャが定義されていなかった場合は空のハッシュを返す
m = /(\d{2}):(\d{2}):(\d{2})/.match("18:37:22")
m.deconstruct_keys(nil) # => {}
//}
@see d:spec/pattern_matc... -
Struct
# deconstruct _ keys(array _ of _ names) -> Hash (6125.0) -
self のメンバの名前と値の組を Hash で返します。
...self のメンバの名前と値の組を Hash で返します。
@param array_of_names 返り値に含めるメンバの名前の配列を指定します。nil の場合は全てのメンバを意味します。
//emlist[例][ruby]{
Customer = 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)
h # => {:name=>"Joseph Smith, Jr.", :address=>"123 Maple, A......345}
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Date
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (6119.0) -
パターンマッチに使用する名前と値の Hash を返します。
...* :yday
* :wday
@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
d = Date.new(2022, 10, 5)
if d in wday: 3, day: ..7 # deconstruct_keys が使われま......g day in month #{month}"
end
#=> "working day in month 10" が出力される
# クラスのチェックと組み合わせて利用することもできます
if d in Date(wday: 3, day: ..7)
puts "first Wednesday of the month"
end
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
DateTime
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (6119.0) -
パターンマッチに使用する名前と値の Hash を返します。
...* :zone
@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
dt = DateTime.new(2022, 10, 5, 13, 30)
if dt in wday: 1..5, hour: 10..18 # deconstruct_keys が使......> "working day in month 10" が出力される
# クラスのチェックと組み合わせて利用することもできます
if dt in DateTime(wday: 1..5, hour: 10..18, day: ..7)
puts "Working time, first week of the month"
end
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Time
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (6119.0) -
パターンマッチに使用する名前と値の Hash を返します。
...st
* :zone
@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
t = Time.utc(2022, 10, 5, 21, 25, 30)
if t in wday: 3, day: ..7 # deconstruct_keys が使わ......ng day in month #{month}"
end
#=> "working day in month 10" が出力される
# クラスのチェックと組み合わせて利用することもできます
if t in Time(wday: 3, day: ..7)
puts "first Wednesday of the month"
end
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
IRB
:: Inspector . keys _ with _ inspector(inspector) -> Array (6113.0) -
引数で指定した IRB::Inspector に対応する key の配列を返します。
...引数で指定した IRB::Inspector に対応する key の配列を返します。
@param inspector IRB::Inspector オブジェクトを指定します。
IRB::Inspector.keys_with_inspector(IRB::Inspector::INSPECTORS[true])
# => [true, :p, "p", :inspect, "inspect"]... -
Win32
:: Registry # num _ keys (3117.0) -
@todo
...@todo
キー情報の個々の値を返します。...