るりまサーチ

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

別のキーワード

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

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

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

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

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

when 節の式をレシーバーとして === を呼...
...

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

//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...
...uts result #=> "child"

def check arg
case arg
when /ruby(?!\s*on\s*rails)/i
"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....

Method#===(*args) -> object (21219.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"
//}...
...ありません。


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

@
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"
/...

Date#===(other) -> bool (21208.0)

同じ日なら真を返します。

...同じ日なら真を返します。

@
param other 日付オブジェクト...

Gem::Platform#===(other) -> bool (21207.0)

自身と other のプラットフォームが一致する場合に真を返します。 そうでない場合は、偽を返します。

...自身と other のプラットフォームが一致する場合に真を返します。
そうでない場合は、偽を返します。

プラットフォームが一致するとは、以下の条件を満たすことです。

* 同じ CPU であること、または、どちらか一方が '...
...universal' であること
* 同じ OS であること
* 同じバージョンであること、または、どちらか一方がバージョンを持たないこと

@
param other 比較対象のオブジェクトです。...

Rinda::DRbObjectTemplate#===(ro) (21117.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....

絞り込み条件を変える

Gem::Requirement#===(version) -> bool (21107.0)

引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。 そうでなければ、false を返します。

...す場合に true を返します。
そうでなければ、false を返します。

@
param version Gem::Version のインスタンスを指定します。

//emlist[][ruby]{
req = Gem::Requirement.new("~> 3.2.1")

p req.satisfied_by?(Gem::Version.new('3.2.9')) # => true
p req.satisfied_by?(Gem::...

Set#===(o) -> bool (21107.0)

オブジェクト o がその集合に属する場合に true を返します。

...オブジェクト o がその集合に属する場合に true を返します。

@
param o オブジェクトを指定します。

//emlist[][ruby]{
require 'set'
set = Set['hello', 'world']
p set.include?('world') # => true
p set.include?('bye') # => false
//}...
...オブジェクト o がその集合に属する場合に true を返します。

@
param o オブジェクトを指定します。

//emlist[][ruby]{
set = Set['hello', 'world']
p set.include?('world') # => true
p set.include?('bye') # => false
//}...

Regexp#===(string) -> bool (18225.0)

文字列 string との正規表現マッチを行います。 マッチした場合は真を返します。

...文字列 string との正規表現マッチを行います。
マッチした場合は真を返します。

string が文字列でもシンボルでもない場合には false を返します。

このメソッドは主にcase文での比較に用いられます。

@
param string マッチ対象...
...文字列

//emlist[例][ruby]{
a = "HELLO"
case a
when /\A[a-z]*\z/; puts "Lower case"
when /\A[A-Z]*\z/; puts "Upper case"
else; puts "Mixed case"
end
# => Upper case

/\A[a-z]*\z/ === "HELLO" # => false
/\A[A-Z]*\z/ === "HELLO" # => true
//}

@
see Enumerable#grep, Object#===...

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

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

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

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

@
param other 任意のオブジェクト
@
return true か 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#eql?...
<< 1 2 3 ... > >>