るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

ライブラリ

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

IPAddr#==(ipaddr) -> bool (21206.0)

IPAddr オブジェクト同士が等しいかを比較します。

...
I
PAddr オブジェクト同士が等しいかを比較します。

@param ipaddr 比較対象の IPAddr オブジェクト。
また、数値や文字列も受け付けます。

例:

require "ipaddr"
p IPAddr.new("192.168.0.1") == IPAddr.new("192.168.0.1/24") # => false...

URI::Generic#==(uri) -> bool (21206.0)

引数に指定した URI (文字列またはURIオブジェクト)との一致判定を行い ます。URI は正規化して比較されます。

...した URI (文字列またはURIオブジェクト)との一致判定を行い
ます。URI は正規化して比較されます。

@param uri 比較したい URI を URI オブジェクトで指定します。

例:
require 'uri'
u1 = URI.parse('http://example.com/?hoge')
u2 = URI.parse('ht...
...tp://Example.Com/?hoge')
p u1 == u2 #=> true...

Exception#==(other) -> bool (21134.0)

自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。

...自身と指定された other のクラスが同じであり、
message と backtrace が == メソッドで比較して
等しい場合に true を返します。そうでない場合に false を返します。

@param other 自身と比較したいオブジェクトを指定します。...
...合は
Exception#exception を実行して変換を試みます。

//emlist[例][ruby]{
require "date"
def check_long_month(month)
return if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end

def get_exception
return begin
yield
rescue => e
e...
...ception { check_long_month(e) } }
p results.map { |e| e.class }
# => [RuntimeError, RuntimeError, RuntimeError]
p results.map { |e| e.message }
# => ["2 is not long month", "2 is not long month", "4 is not long month"]

# class, message, backtrace が同一のため true になる
p results[0] == re...

Rational#==(other) -> bool (21130.0)

数値として等しいか判定します。

...なければ false を返します。

//emlist[例][ruby]{
Rational(2, 3) == Rational(2, 3) # => true
Rational(5) == 5 # => true
Rational(0) == 0.0 # => true
Rational('1/3') == 0.33 # => false
Rational('1/2') == '1/2' # => false
//}...
...でなければ false を返します。

//emlist[例][ruby]{
Rational(2, 3) == Rational(2, 3) # => true
Rational(5) == 5 # => true
Rational(0) == 0.0 # => true
Rational('1/3') == 0.33 # => false
Rational('1/2') == '1/2' # => false
//}...

String#==(other) -> bool (21124.0)

other が文字列の場合、String#eql? と同様に文字列の内容を比較します。

...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。

other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false...
.../emlist[例][ruby]{
stringlike = Object.new

def stringlike.==(other)
"string" == other
end

p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> false

def stringlike.to_str
raise
end

p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> true
//}

@see String#e...

絞り込み条件を変える

Digest::Base#==(md) -> bool (21113.0)

与えられたダイジェストオブジェクトと比較します。

...ェストオブジェクト

require 'digest/md5'
digest1 = Digest::MD5.new
digest1.update("ruby")
digest2 = Digest::MD5.new
digest2.update("ruby")
p digest1 == digest2 # => true
digest2.update("RUBY")
p digest1 == digest2 # => false...

BasicObject#==(other) -> bool (21112.0)

オブジェクトが other と等しければ真を、さもなくば偽を返します。

...//emlist[例][ruby]{
class Person < BasicObject
def initialize(name, age)
@name = name
@age = age
end
end

tanaka1 = Person.new("tanaka", 24)
tanaka2 = Person.new("tanaka", 24)

tanaka1 == tanaka1 #=> true
tanaka1 == tanaka2 #=> false
//}

@see BasicObject#equal?, Object#==, Obje...

Fiddle::Pointer#==(other) -> bool (21112.0)

ポインタの指すアドレスが同一ならばtrueを返します。

...タの指すアドレスが同一ならばtrueを返します。

@param other 比較対象の Pointer オブジェクト

例:

require 'fiddle'

s = 'abc'
cptr = Fiddle::Pointer[s]
cptr0 = Fiddle::Pointer[s]
cptr1 = cptr + 1

p cptr == cptr1 #=> false
p cptr == cptr0 #=> true...

Integer#==(other) -> bool (21112.0)

比較演算子。数値として等しいか判定します。

...比較演算子。数値として等しいか判定します。

@param other 比較対象の数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}...

Digest::Base#==(str) -> bool (21108.0)

与えられた文字列を hexdigest 値と見て、自身の hexdigest 値と比較します。

...与えられた文字列を hexdigest 値と見て、自身の hexdigest 値と比較します。

@param str 比較対象の hexdigest 文字列

require 'digest/md5'
digest = Digest::MD5.new
digest.update("ruby")
p digest == "58e53d1324eef6265fdb97b08ed9aadf" # =>...

絞り込み条件を変える

<< 1 2 3 ... > >>