るりまサーチ

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

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

オブジェクト

検索結果

<< 1 2 3 ... > >>

OpenSSL::X509::Name (18028.0)

X.500の識別名(DN, Distinguished Name)を表わすクラス。

...X.500の識別名(DN, Distinguished Name)を表わすクラス。

eql? と hash が定義されているため、Hash のキーとして
利用できます。...

OpenSSL::X509::Name#hash_old -> Integer (9113.0)

OpenSSL 0.9.8 と互換な古い方式のハッシュ関数の ハッシュ値を返します。

...OpenSSL 0.9.8 と互換な古い方式のハッシュ関数の
ハッシュ値を返します。

内部では OpenSSL の X509_NAME_hash_old を呼び出します。...

Pathname#hash -> Integer (9101.0)

ハッシュ値を返します。

ハッシュ値を返します。

Rake::TaskArguments#to_hash -> Hash (6232.0)

パラメータ名と対応する値を格納したハッシュを返します。

...納したハッシュを返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments.to_hash # => {:name1=>"value1", :name2=>"value2"}
end
//}...

MatchData#named_captures -> Hash (6229.0)

名前付きキャプチャをHashで返します。

...キャプチャをHashで返します。

Hash
のキーは名前付きキャプチャの名前です。Hashの値はキーの名前に対応した名前付きグループのうち最後にマッチした文字列です。

//emlist[例][ruby]{
m = /(?<a>.)(?<b>.)/.match("01")
m.named_captures # => {...
..."a" => "0", "b" => "1"}

m = /(?<a>.)(?<b>.)?/.match("0")
m.named_captures # => {"a" => "0", "b" => nil}

m = /(?<a>.)(?<a>.)/.match("01")
m.named_captures # => {"a" => "1"}

m = /(?<a>x)|(?<a>y)/.match("x")
m.named_captures # => {"a" => "x"}
//}

@see MatchData#captures...

絞り込み条件を変える

Data#hash -> Integer (6131.0)

自身のハッシュ値を整数で返します。 Data#eql? で比較して等しいオブジェクトは同じハッシュ値を返します。

...を返します。

//emlist[例][ruby]{
Dog = Data.define(:name, :age)
dog1 = Dog.new("Fred", 5)
p dog1.hash # => -3931425561194935428
dog2 = Dog.new("Fred", 5)
p dog2.hash # => -3931425561194935428
dog3 = Dog.new("Fred", 6)
p dog3.hash # => -4469132459285820530
//}

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

@see Object#hash...

Regexp#named_captures -> { String => [Integer] } (6128.0)

正規表現に含まれる名前付きキャプチャ(named capture)の情報を Hash で返します。

...付きキャプチャ(named capture)の情報を
Hash
で返します。

Hash
のキーは名前付きキャプチャの名前で、値は
その名前に関連付けられたキャプチャの index のリストを返します。

//emlist[例][ruby]{
/(?<foo>.)(?<bar>.)/.named_captures
# => {"foo...
..."=>[1], "bar"=>[2]}

/(?<foo>.)(?<foo>.)/.named_captures
# => {"foo"=>[1, 2]}

# 名前付きキャプチャを持たないときは空の Hash を返します。
/(.)(.)/.named_captures
# => {}
//}...

Struct#hash -> Integer (6125.0)

self が保持するメンバのハッシュ値を元にして算出した整数を返します。 self が保持するメンバの値が変化すればこのメソッドが返す値も変化します。

...ばこのメソッドが返す値も変化します。

//emlist[例][ruby]{
Dog = Struct.new(:name, :age)
dog = Dog.new("fred", 5)
p dog.hash #=> 7917421
dog.name = "john"
p dog.hash #=> -38913223
//}

[注意] 本メソッドの記述は Struct の下位クラ...

Etc.#uname -> {Symbol => String} (6122.0)

uname(2) で取得したシステム情報を Hash で返します。

...uname(2) で取得したシステム情報を Hash で返します。

@return 少なくとも :sysname, :nodename, :release, :version, :machine の
5 つのキーを持つ Hash を返します。

//emlist[例][ruby]{
require 'etc'
require 'pp'

pp Etc.uname
# => {:sysname=>"Linux",
#...
...:nodename=>"boron",
# :release=>"2.6.18-6-xen-686",
# :version=>"#1 SMP Thu Nov 5 19:54:42 UTC 2009",
# :machine=>"i686"}
//}...

REXML::Attributes#namespaces -> { String => String } (6106.0)

self の中で宣言されている名前空間の集合を返します。

...self の中で宣言されている名前空間の集合を返します。

返り値は名前空間の prefix をキーとし、URI を値とする
Hash
を返します。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xm...
...lns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>