るりまサーチ

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

別のキーワード

  1. openssl public_key
  2. _builtin each_key
  3. openssl public_key=
  4. dbm key
  5. socket pf_key

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

GDBM#keys -> [String] (27308.0)

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

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

require 'gdbm'

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

SDBM#keys -> [String] (27308.0)

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

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

require 'sdbm'

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

Thread#keys -> [Symbol] (27308.0)

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

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

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

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

DBM#keys -> [String] (27302.0)

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

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

Data#deconstruct_keys(array_of_names_or_nil) -> hash (18420.0)

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

...Hash で返します。

//emlist[例][ruby]{
Measure = Data.define(:amount, :unit)

d
istance = Measure.new(10, 'km')
d
istance.deconstruct_keys(nil) # => {:amount=>10, :unit=>"km"}
d
istance.deconstruct_keys([:amount]) # => {:amount=>10}
//}

このメソッドは以下のようにパターン...
...

//emlist[例][ruby]{
Measure = Data.define(:amount, :unit)
d
istance = 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" が表示...
...case distance
in Measure(amount:, unit: 'km')
puts "It is #{amount} kilometers away"
# ...
end
//}

@param array_of_names_or_nil 返り値に含めるメンバの名前の配列を指定します。nil の場合は全てのメンバを意味します。

[注意] 本メソッドの記述は Data...

絞り込み条件を変える

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

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

...ansform_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_s...
...ym) # => {: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_val...

Hash#transform_keys {|key| ... } -> Hash (12447.0)

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

...form_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 (12353.0)

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

...ansform_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_s...
...ym) # => {: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_val...

Hash#transform_keys!(hash) -> self (12353.0)

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

...ansform_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_s...
...ym) # => {: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_val...

Hash#transform_keys -> Enumerator (12347.0)

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

...form_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 (12347.0)

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

...form_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!...

Net::IMAP#thread(algorithm, search_keys, charset) -> [Net::IMAP::ThreadMember] (6414.0)

THREADコマンドを送り、メールボックスを検索した結果を スレッド形式の木構造で返します。

...THREADコマンドを送り、メールボックスを検索した結果を
スレッド形式の木構造で返します。

THREAD コマンドは 5256 で定義されています。
詳しくはそちらを参照してください。
このコマンドは Net::IMAP#capability の返り値を見...
...以下の2つが利用可能です。
* "ORDEREDSUBJECT" subjectを使って平坦に区切るだけ
* "REFERENCES" どのメッセージに返事をしているかを見て木構造を作る
詳しくは 5256 を見てください。

search_key には検索条件を渡します。
Net::IMAP#s...
...earch と同等です。


@param algorithm スレッド構造構築アルゴリズム名(文字列)
@param search_key 検索条件(文字列配列)
@param charset 検索条件の解釈に用いるCHARSET名(文字列)
@see Net::IMAP::ThreadMember, Net::IMAP#uid_thread...

Net::IMAP#uid_search(keys, charset = nil) -> [Integer] (6414.0)

UID SEARCH コマンドを送り、条件に合うメッセージの UID を配列で返します。

...UID SEARCH コマンドを送り、条件に合うメッセージの UID
を配列で返します。

Net::IMAP#examine もしくは Net::IMAP#select で
指定したメールボックスを検索対象とします。

検索の条件は key に文字列の1次元配列もしくは文字列で渡...
...6.4.4 を見てください。

例:
p imap.uid_search(["SUBJECT", "hello"])
#=> [1, 6, 7, 8]
p imap.uid_search(["SUBJECT", "hello", "FROM", "foo@example.com"])
#=> [6, 7]
p imap.uid_search('SUBJECT "hello"')
#=> [1, 6, 7, 8]

@param key 検索キー(文字列の配列もしくは文字...
...列)
@param charset 検索に用いるcharset
@see Net::IMAP#uid_search...

Net::IMAP#uid_thread(algorithm, search_keys, charset) -> [Net::IMAP::ThreadMember] (6408.0)

THREADコマンドを送り、メールボックスを検索した結果を スレッド形式の木構造で返します。

...THREADコマンドを送り、メールボックスを検索した結果を
スレッド形式の木構造で返します。

ほぼ Net::IMAP#thread と同じですが、返ってくるオブジェクトの
Net::IMAP::ThreadMember#seqno の内容が message sequence number
ではなく UID とな...
...ります。

@param algorithm スレッド構造構築アルゴリズム名(文字列)
@param search_key 検索条件(文字列配列)
@param charset 検索条件の解釈に用いるCHARSET名(文字列)
@see Net::IMAP::ThreadMember, Net::IMAP#thread...

DBM#update(other) {|key, value| ... } -> self (6308.0)

self と other の内容をマージします。

...ブジェクトでなければなりません。


require 'dbm'

d
b1 = DBM.open('aaa.db', 0666, DBM::NEWDB)
d
b1[:a] = 'aaa'
d
b1[:b] = 'bbbbbb'
d
b2 = DBM.open('bbb.db', 0666, DBM::NEWDB)
d
b2[:bb] = 'bbb'
d
b2[:cc] = 'ccc'

d
b1.update(db2)
p db1.keys #=> ["bb", "cc", "b", "a"]...

絞り込み条件を変える

<< 1 2 > >>