るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Object#==(other) -> bool (24225.0)

オブジェクトと other が等しければ真を返します。

...オブジェクトと other が等しければ真を返します。

このメソッドは各クラスの性質に合わせて再定義すべきです。
多くの場合、オブジェクトの内容が等しければ真を返すように
(同値性を判定するように)再定義されるこ...
...す。

@param other 比較するオブジェクトです。

//emlist[例][ruby]{
o = Object.new
p(o.eql?(o)) #=> true
p(o.eql?(Object.new)) #=> false
//}

下記の例のように、各クラスの性質に合わせて再定義されることが期待されています。

//emlist[適切に再定...
...義されている例][ruby]{
p("foo" == "bar") #=> false
p("foo" == "foo") #=> true

p(4 == 4) #=> true
p(4 == 4.0) #=> true
//}

@see Object#equal?,Object#eql?...

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

オブジェクトが other と等しければ真を、そうでない場合は偽を返します。

...オブジェクトが other と等しければ真を、そうでない場合は偽を返します。

このメソッドは各クラスの性質に合わせて、サブクラスで再定義するべきです。
多くの場合、オブジェクトの内容が等しければ真を返すように (同...
...ルトでは Object#equal? と同じオブジェクトの同一性になっています。

@param other 比較対象となるオブジェクト
@return other が self と同値であれば真、そうでない場合は偽

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

t
anaka1 = Person.new("tanaka", 24)
t
anaka2 = Person.new("tanaka", 24)

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

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

DRb::DRbObject#==(other) -> bool (24201.0)

DRb::DRbObject オブジェクト同士が同じであるなら真を返します。

...DRb::DRbObject オブジェクト同士が同じであるなら真を返します。

この同値判定は、
オブジェクトが参照している URI と識別子が等しいかどうかでします。...

Delegator#==(obj) -> bool (21201.0)

自身が与えられたオブジェクトと等しい場合は、真を返します。 そうでない場合は、偽を返します。

...自身が与えられたオブジェクトと等しい場合は、真を返します。
そうでない場合は、偽を返します。

@param obj 比較対象のオブジェクトを指定します。...

Object#===(other) -> bool (18307.0)

case 式で使用されるメソッドです。d:spec/control#case も参照してください。

...spec/control#case も参照してください。

このメソッドは case 式での振る舞いを考慮して、
各クラスの性質に合わせて再定義すべきです。

デフォルトでは内部で Object#== を呼び出します。

when 節の式をレシーバーとして === を...
...ther 比較するオブジェクトです。

//emlist[][ruby]{
age = 12
# (0..2).===(12), (3..6).===(12), ... が実行される
result =
case age
when 0 .. 2
"baby"
when 3 .. 6
"little child"
when 7 .. 12
"child"
when 13 .. 18
"youth"
else
"adult"
end

puts result...
...hit! #{arg}"
when String
"Instance of String class. But don't hit."
else
"unknown"
end
end

puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's world>
//}

@see Object#==, Range#===...

絞り込み条件を変える

Rinda::DRbObjectTemplate#===(ro) (18201.0)

@todo

...@todo

T
his DRbObjectTemplate matches +ro+ if the remote object's drburi
and drbref are the same. +nil+ is used as a wildcard....

Method#===(*args) -> object (15401.0)

メソッドオブジェクトに封入されているメソッドを起動します。

...せん。


@param args self に渡される引数。

@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2"
//}...
...f に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2"
//}...
...@param args self に渡される引数。

@see UnboundMethod#bind_call

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2"
//}...

Enumerable#partition {|item| ... } -> [[object], [object]] (12407.0)

各要素を、ブロックの条件を満たす要素と満たさない要素に分割します。 各要素に対してブロックを評価して、その値が真であった要素の配列と、 偽であった要素の配列の 2 つを配列に入れて返します。

...要素の配列と、
偽であった要素の配列の 2 つを配列に入れて返します。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0].partition {|i| i % 3 == 0 }
#=> [[9, 6, 3, 0], [10, 8, 7, 5, 4, 2, 1]]
//}...

Array#reject {|item| ... } -> [object] (12307.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...を返します。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject...
...件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject
@see Enumerable#grep_v...
<< 1 2 3 ... > >>