るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n=
  3. rsa n
  4. openssl n=
  5. openssl n

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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
a
nd 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...
<< 1 2 3 ... > >>