1140件ヒット
[1-100件を表示]
(0.191秒)
ライブラリ
- ビルトイン (616)
- gdbm (11)
- ipaddr (11)
- openssl (11)
- optparse (132)
- pathname (11)
- prime (22)
- psych (66)
-
rexml
/ parsers / sax2parser (55) -
rexml
/ streamlistener (88) -
rinda
/ rinda (11) -
rinda
/ tuplespace (11) - rubygems (11)
-
rubygems
/ requirement (33) - sdbm (22)
- set (7)
- timeout (22)
クラス
- Array (82)
- Bignum (3)
- GDBM (11)
-
Gem
:: Requirement (33) - Hash (11)
- IPAddr (11)
- Integer (11)
- Module (30)
- Object (33)
-
OpenSSL
:: BN (11) - OptionParser (132)
- Pathname (11)
- Prime (22)
- Proc (44)
-
Psych
:: Handler (66) -
REXML
:: Parsers :: SAX2Parser (55) - Range (21)
- Regexp (44)
-
Rinda
:: DRbObjectTemplate (11) -
Rinda
:: TupleSpace (11) - SDBM (22)
- Set (7)
- String (165)
モジュール
- Enumerable (172)
- Kernel (33)
-
REXML
:: StreamListener (88)
キーワード
- % (11)
- <=> (11)
- =~ (22)
- [] (77)
- alias (11)
- all? (27)
- any? (42)
- attlistdecl (11)
- call (11)
- cdata (11)
- clone (11)
- doctype (11)
- dup (11)
- each (22)
- elementdecl (11)
-
end
_ document (11) - gem (11)
- grep (22)
-
grep
_ v (22) - include? (23)
- instruction (11)
- invert (11)
- length (11)
- listen (55)
- match (22)
- member? (5)
-
module
_ function (19) - none? (39)
- notify (11)
- on (132)
- one? (39)
- pack (19)
-
satisfied
_ by? (11) - scalar (11)
- size (11)
- slice (66)
-
slice
_ after (22) -
slice
_ before (22) -
start
_ document (11) -
start
_ mapping (11) -
start
_ sequence (11) - sync (11)
-
tag
_ end (11) -
tag
_ start (11) - timeout (22)
-
undef
_ method (11) - unpack (11)
- xmldecl (11)
- yield (11)
検索結果
先頭5件
-
Gem
:: Requirement # ===(version) -> bool (21201.0) -
引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。 そうでなければ、false を返します。
...引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。
そうでなければ、false を返します。
@param version Gem::Version のインスタンスを指定します。
//emlist[][ruby]{
req = Gem::Requirement.new("~> 3.2.1")
p req.satisfi......ed_by?(Gem::Version.new('3.2.9')) # => true
p req.satisfied_by?(Gem::Version.new('3.3.0')) # => false
//}... -
Range
# ===(obj) -> bool (21131.0) -
始端と終端の中に obj があるとき、true を返します。 そうでないとき、false を返します。
...false を返します。
Range#=== は主に case 式での比較に用いられます。
<=> メソッドによる演算により範囲内かどうかを判定するには Range#cover? を使用してください。
始端・終端・引数が数値であれば、 Range#cover? と同様の動き......クトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range#cover?......ange#=== は主に case 式での比較に用いられます。
//emlist[例][ruby]{
p (0...50) === 79 #=> false
p (60...80) === 79 #=> true
case 79
when 0...60 then puts "low"
when 60...80 then puts "medium" # => medium
when 80..100 then puts "high"
end
//}
2.5 以前は、単純に Rang......e#include? メソッドを内部で呼んでいました。
しかし、2.6 以降では、(文字列を除いて) Range#cover? と同様の処理をするように切り替わりました。
ただし、=== は、Range#cover? のように Range オブジェクトを引数にはとる設計はあ......include?(DateTime.now) #=> false
p (Date.today - 100...Date.today + 100).cover?(DateTime.now) #=> true
p (Date.today - 100...Date.today + 100) === DateTime.now #=> true
# 2.5 以前は、=== は、include? と同じく比較できず false を返していました。
//}
@see d:spec/con......nclude?(DateTime.now) #=> false
p (Date.today - 100...Date.today + 100).cover?(DateTime.now) #=> true
p (Date.today - 100...Date.today + 100) === DateTime.now #=> true
# 2.5 以前は、=== は、include? と同じく比較できず false を返していました。
//}
2.7 以降の ===... -
Rinda
:: DRbObjectTemplate # ===(ro) (21101.0) -
@todo
...@todo
This DRbObjectTemplate matches +ro+ if the remote object's drburi
and drbref are the same. +nil+ is used as a wildcard.... -
Regexp
# ===(string) -> bool (18213.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#===... -
Proc
# ===(*arg) -> () (18161.0) -
手続きオブジェクトを実行してその結果を返します。
...てください。
「===」は when の所に手続きを渡せるようにするためのものです。
//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end
p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1
//}
また......、以下のような syntactic sugar もあります。
//emlist[例][ruby]{
fib = lambda{|n|
case n
when 0 then 0
when 1 then 1
else
fib.(n - 2) + fib.(n - 1)
end
}
fib.(10) # => 55
//}
@param arg 手続きオブジェクトに与える引数を指定します。
@raise LocalJum... -
Bignum
# ===(other) -> bool (18101.0) -
比較演算子。数値として等しいか判定します。
...比較演算子。数値として等しいか判定します。
@param other 比較対象の数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。... -
Integer
# ===(other) -> bool (18101.0) -
比較演算子。数値として等しいか判定します。
...比較演算子。数値として等しいか判定します。
@param other 比較対象の数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}... -
OpenSSL
:: BN # ===(other) -> bool (18101.0) -
自身と other が等しい場合に true を返します。
自身と other が等しい場合に true を返します。
@param other 比較する数 -
Pathname
# ===(other) -> bool (18101.0) -
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
...other は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジ......ェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar") == Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") == Pathname.new("foo/bar")
# => true
# false
# false
//}... -
String
# ===(other) -> bool (18101.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false......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" == stringlik......e #=> true
//}
@see String#eql?...