るりまサーチ

最速Rubyリファレンスマニュアル検索!
518件ヒット [1-100件を表示] (0.166秒)

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

CGI::QueryExtension#keys(*args) -> [String] (21202.0)

すべてのパラメータのキーを配列として返します。

すべてのパラメータのキーを配列として返します。

Thread#keys -> [Symbol] (21108.0)

スレッド固有データに関連づけられたキーの配列を返します。キーは Symbol で返されます。

...スレッド固有データに関連づけられたキーの配列を返します。キーは
Symbol で返されます。

t
h = Thread.current
t
h[:foo] = 'FOO'
t
h['bar'] = 'BAR'
p th.keys

#=> [:bar, :foo]...

Win32::Registry#keys (21102.0)

@todo

...@todo...

GDBM#keys -> [String] (18208.0)

データベース中に存在するキー全てを含む配列を返します。

...データベース中に存在するキー全てを含む配列を返します。

require 'gdbm'

db1 = GDBM.open('aaa.gdbm', 0666, GDBM::NEWDB)
db1['a'] = 'aaa'
db1['b'] = 'bbb'
p db1.keys #=> ["a", "b"]...

Hash#keys -> [object] (18208.0)

全キーの配列を返します。

...全キーの配列を返します。

//emlist[例][ruby]{
h1 = { "a" => 100, 2 => ["some"], :c => "c" }
p h1.keys #=> ["a", 2, :c]
//}

@see Hash#values,Hash#to_a...

絞り込み条件を変える

SDBM#keys -> [String] (18208.0)

データベース中に存在するキー全てを含む配列を返します。

...データベース中に存在するキー全てを含む配列を返します。

require 'sdbm'

db1 = SDBM.open('aaa.gdbm', 0666)
db1['a'] = 'aaa'
db1['b'] = 'bbb'
db1['c'] = 'ccc'
p db1.keys #=> ["a", "b","c"]...

DBM#keys -> [String] (18202.0)

データベース中に存在するキー全てを含む配列を返します。

データベース中に存在するキー全てを含む配列を返します。

Struct#deconstruct_keys(array_of_names) -> Hash (15214.0)

self のメンバの名前と値の組を Hash で返します。

...のメンバを意味します。

//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, Anytown NC", :zip=>12345}
//}

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラ...
...スを作成する点に
注意してください。

@see d:spec/pattern_matching#matching_non_primitive_objects...

CSV::Row#deconstruct_keys(keys) -> Hash (12309.0)

パターンマッチに使用するヘッダの名前と値の Hash を返します。

...ーをシンボルに変換する必要があります。

@param keys パターンマッチに使用するヘッダの名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。

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

row = CSV::Row.new([:header1, :header2,...
.... }
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 (12240.0)

すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。

...eturn 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!(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#trans...

絞り込み条件を変える

Hash#transform_keys! {|key| ... } -> self (12240.0)

すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。

...eturn 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!(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#trans...
<< 1 2 3 ... > >>