1217件ヒット
[1-100件を表示]
(0.198秒)
ライブラリ
- ビルトイン (658)
- date (12)
- matrix (24)
- openssl (12)
- optparse (144)
- pathname (12)
- prime (24)
- psych (60)
-
rexml
/ parsers / sax2parser (60) -
rexml
/ streamlistener (96) -
rinda
/ rinda (12) -
rinda
/ tuplespace (12) - rubygems (12)
-
rubygems
/ platform (12) -
rubygems
/ requirement (36) - set (15)
- timeout (16)
クラス
- Array (86)
- Bignum (3)
- Date (12)
-
Gem
:: Platform (12) -
Gem
:: Requirement (36) - Hash (24)
- Integer (12)
- Method (32)
- Module (48)
- Object (48)
-
OpenSSL
:: BN (12) - OptionParser (144)
- Pathname (12)
- Prime (24)
-
Psych
:: Handler (60) -
REXML
:: Parsers :: SAX2Parser (60) - Regexp (48)
-
Rinda
:: DRbObjectTemplate (12) -
Rinda
:: TupleSpace (12) - Set (24)
- String (180)
- Vector (24)
モジュール
- Enumerable (168)
- Kernel (28)
-
REXML
:: StreamListener (96)
キーワード
- % (12)
- * (24)
- <=> (12)
- =~ (24)
- [] (80)
- all? (45)
- any? (32)
- attlistdecl (12)
- call (16)
- cdata (12)
- clone (12)
- doctype (12)
- dup (12)
- each (24)
- elementdecl (12)
-
end
_ document (12) - gem (12)
- grep (24)
-
grep
_ v (24) - include? (8)
- instruction (12)
- invert (12)
- listen (60)
- match (24)
- member? (8)
-
module
_ function (36) - none? (15)
- notify (12)
- on (144)
- one? (45)
- pack (21)
-
satisfied
_ by? (12) - scalar (12)
- slice (72)
-
slice
_ after (24) -
slice
_ before (24) -
start
_ document (12) -
start
_ mapping (12) -
start
_ sequence (12) -
tag
_ end (12) -
tag
_ start (12) - timeout (16)
-
undef
_ method (12) - unpack (12)
- xmldecl (12)
検索結果
先頭5件
-
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
This 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?...