ライブラリ
クラス
-
ARGF
. class (88) - Addrinfo (44)
- Array (339)
- BasicObject (11)
- BasicSocket (11)
- BigDecimal (11)
- Binding (11)
- CGI (11)
-
CSV
:: Table (11) -
Enumerator
:: ArithmeticSequence (6) -
Enumerator
:: Lazy (118) - Exception (11)
- Float (11)
- GDBM (11)
-
Gem
:: Requirement (11) - Hash (67)
- IPAddr (11)
- Integer (14)
- Matrix (55)
- Method (11)
- Numeric (11)
- Object (33)
- Pathname (44)
- Prime (22)
- Proc (44)
- Random (33)
- Range (126)
- Rational (11)
- Regexp (11)
-
Rinda
:: DRbObjectTemplate (11) -
RubyVM
:: InstructionSequence (22) - SDBM (11)
- String (200)
- StringScanner (11)
- Symbol (22)
- UnboundMethod (44)
-
WIN32OLE
_ TYPE (11) -
Zlib
:: GzipReader (11)
モジュール
- Enumerable (422)
-
Rake
:: Cloneable (11)
キーワード
- === (55)
- [] (77)
-
_ _ id _ _ (11) - afamily (11)
- allbits? (7)
- assoc (22)
-
backtrace
_ locations (11) - call (11)
- chunk (22)
-
chunk
_ while (11) - clone (33)
- collect (11)
- count (66)
- crypt (11)
-
default
_ event _ sources (11) - delete (11)
-
delete
_ if (22) - detect (22)
- disasm (11)
- disassemble (11)
- divmod (11)
- downcase (8)
- dup (11)
- each (66)
-
each
_ line (44) - eigen (11)
- eigensystem (11)
- eql? (22)
- filter (12)
- filter! (12)
- find (22)
-
find
_ all (22) -
find
_ index (66) - getpeername (11)
- hash (44)
- header (11)
- id2name (11)
- include? (38)
- index (33)
- join (11)
-
keep
_ if (11) - lazy (22)
- lineno= (11)
-
local
_ variable _ defined? (11) - lup (11)
-
lup
_ decomposition (11) - map (11)
-
marshal
_ dump (11) -
marshal
_ load (11) - max (118)
- member? (16)
- min (118)
- minmax (10)
- nobits? (7)
- none? (47)
- one? (47)
- pack (19)
- partition (22)
- pfamily (11)
- protocol (11)
- rassoc (22)
- rectangular (11)
- reject (33)
- reject! (22)
- remainder (11)
- rindex (33)
-
satisfied
_ by? (11) - select (44)
- select! (22)
- sign (11)
- slice (66)
-
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) - socktype (11)
- sort (22)
- split (17)
- string (11)
-
to
_ s (11) -
unicode
_ normalize! (10) - unpack (11)
- yield (11)
検索結果
先頭5件
-
Range
# ==(other) -> bool (24135.0) -
指定された other が Range クラスのインスタンスであり、 始端と終端が == メソッドで比較して等しく、Range#exclude_end? が同じ場合に true を返します。そうでない場合に false を返します。
...指定された other が Range クラスのインスタンスであり、
始端と終端が == メソッドで比較して等しく、Range#exclude_end? が同じ場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェ......クトを指定します。
//emlist[例][ruby]{
p (1..2) == (1..2) # => true
p (1..2) == (1...2) # => false
p (1..2) == Range.new(1.0, 2.0) # => true
//}... -
Rational
# ==(other) -> bool (24131.0) -
数値として等しいか判定します。
...@param other 自身と比較する数値
@return self と other が等しい場合 true を返します。
そうでなければ 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
//}... -
Pathname
# ==(other) -> bool (24119.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
//}... -
Random
# ==(other) -> bool (24119.0) -
乱数生成器が等しい状態であるならばtrue を返します。
...乱数生成器が等しい状態であるならばtrue を返します。
@param other 比較対象の乱数生成器
//emlist[例][ruby]{
r1 = Random.new(1)
r2 = Random.new(1)
p r1 == r2 # => true
r2.rand
p r1 == r2 # => false
r1.rand
p r1 == r2 # => true
//}... -
Enumerator
:: ArithmeticSequence # ==(other) -> bool (24101.0) -
Enumerable::ArithmeticSequence として等しいか判定します。
...Enumerable::ArithmeticSequence として等しいか判定します。
other が Enumerable::ArithmeticSequence で
begin, end, step, exclude_end? が等しい時に
true を返します。
@param other 自身と比較する Enumerable::ArithmeticSequence... -
UnboundMethod
# ==(other) -> bool (21131.0) -
自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。
...場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
a = String.instance_method(:size)
b = String.instance_method(:size)
p a == b #=> true
c = Array.instance_method(:size)
p a == c......#=> false
//}... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (18507.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...on#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Date.n......0, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get......_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Range
# ===(obj) -> bool (18225.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...場合は、false を返します。
Range#=== は主に case 式での比較に用いられます。
<=> メソッドによる演算により範囲内かどうかを判定するには Range#cover? を使用してください。
始端・終端・引数が数値であれば、 Range#cover? と同......をします。
@param obj 比較対象のオブジェクトを指定します。
//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) # => tr......ue
//}
@see d:spec/control#case
@see Range#cover?......、false を返します。
Range#=== は主に 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
//}.......5 以前は、単純に Range#include? メソッドを内部で呼んでいました。
しかし、2.6 以降では、(文字列を除いて) Range#cover? と同様の処理をするように切り替わりました。
ただし、=== は、Range#cover? のように Range オブジェクトを......e 'date'
p (Date.today - 100...Date.today + 100).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... -
Rinda
:: DRbObjectTemplate # ===(ro) (18207.0) -
@todo
...@todo
This DRbObjectTemplate matches +ro+ if the remote object's drburi
and drbref are the same. +nil+ is used as a wildcard.... -
Range
# ===(obj) -> bool (18201.0) -
始端と終端の中に obj があるとき、true を返します。 そうでないとき、false を返します。
...、false を返します。
Range#=== は主に 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
//}.......5 以前は、単純に Range#include? メソッドを内部で呼んでいました。
しかし、2.6 以降では、(文字列を除いて) Range#cover? と同様の処理をするように切り替わりました。
ただし、=== は、Range#cover? のように Range オブジェクトを......e 'date'
p (Date.today - 100...Date.today + 100).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... -
Array
# find _ index -> Enumerator (15307.0) -
条件に一致する最初の要素の位置を返します。
...ます。
@param val 位置を知りたいオブジェクトを指定します。
指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p......0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを実行し、
ブロックが真を返した最初の要素の位置を返します。
一つも真にならなかった場合は nil を返......します。
//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}
引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。
@see Array#rindex...