ライブラリ
- ビルトイン (230)
- bigdecimal (48)
-
minitest
/ unit (1) -
rubygems
/ requirement (24) - time (48)
- tracer (24)
クラス
モジュール
- Comparable (24)
- Enumerable (32)
-
MiniTest
:: Assertions (1)
キーワード
- > (12)
- Numeric (12)
- OPS (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
-
assert
_ in _ epsilon (1) - between? (12)
- bigdecimal (12)
- bsearch (48)
-
bsearch
_ index (20) - ceil (12)
- floor (24)
- none? (53)
- parse (24)
-
ruby 1
. 6 feature (12) -
set
_ get _ line _ procs (24) - strptime (24)
-
to
_ s (12) - 制御構造 (12)
- 正規表現 (12)
- 演算子式 (12)
検索結果
先頭5件
-
Comparable
# >=(other) -> bool (21218.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が正の整数か 0 を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
...、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。
@raise ArgumentError <=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 >= 0 # => true
1 >= 1 #......=> true
1 >= 2 # => false
//}... -
Integer
# >=(other) -> bool (21218.0) -
比較演算子。数値として等しいまたは大きいか判定します。
...。
@param other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 >= 0 # => true
1 >= 1 # => true
1 >= 2 # =>... -
Module
# >=(other) -> bool | nil (18236.0) -
比較演算子。self が other の先祖か同一クラスである場合、 true を返します。 self が other の子孫である場合、false を返します。
...ther の先祖か同一クラスである場合、 true を返します。
self が other の子孫である場合、false を返します。
継承関係にないクラス同士の比較では
nil を返します。
@param other 比較対象のモジュールやクラス
@raise TypeError other......dule#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo >= Bar # => true
Bar >= Foo # => false
Baz.ancestors # => [Foo, Baz]
Foo >= Baz # => true
Baz >= Foo # => false
Foo >= Foo # => true
Foo >= Object # => nil
//}... -
Hash
# >=(other) -> bool (18218.0) -
other が self のサブセットか同じである場合に真を返します。
...other が self のサブセットか同じである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 >= h2 # => false
h2 >= h1 # => true
h1 >= h1 # => true
//}
@see... -
Float
# >=(other) -> bool (18206.0) -
比較演算子。数値として等しいまたは大きいか判定します。
...す。
@param other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 > 3.1415 # => false
3.14 >= 3.1415 # =>... -
BigDecimal
# >=(other) -> bool (18200.0) -
self が other より大きいか等しい場合に true を、そうでない場合に false を返します。
...self が other より大きいか等しい場合に true を、そうでない場合に false
を返します。... -
Complex
# >=(other) -> bool (18200.0) -
@undef
@undef -
Fixnum
# >=(other) -> bool (18200.0) -
比較演算子。数値として等しいまたは大きいか判定します。
...演算子。数値として等しいまたは大きいか判定します。
@param other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。... -
MiniTest
:: Assertions # assert _ in _ epsilon(actual , expected , epsilon = 0 . 001 , message = nil) -> true (9106.0) -
与えられた期待値と実際の値の相対誤差が許容範囲内である場合、検査にパスしたことになります。
...パスします。
[expected, actual].min * epsilon >= (extected - actual).abs
@param expected 期待値を指定します。
@param actual 実際の値を指定します。
@param epsilon 許容する相対誤差を指定します。
@param message 検査に失敗した場合に表示する......メッセージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 検査に失敗した場合に発生します。... -
BigDecimal
# floor -> Integer (6206.0) -
self 以下の最大整数を返します。
...数を返します。
@param n 小数点以下の桁数を整数で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").floor # => 1
BigDecimal("-1.23456").floor # => -2
//}
以下のように引数 n を与えることもできます。
n >= 0 なら、小数点以......にします)。
n が負のときは小数点以上 n 桁目を操作します
(小数点位置から左に少なくとも n 個の 0 が並びます)。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").floor(4).to_f # => 1.2345
BigDecimal("15.23456").floor(-1).to_f # => 10.0
//}... -
Tracer
. set _ get _ line _ procs(filename , proc) (6206.0) -
あるファイルについて利用する、行番号からソースのその行の内容を返す 手続きを指定します。何も指定しなければデフォルトの動作が利用されます。 指定する手続きは行番号を唯一の引数として呼び出されます。
...@param filename ソースファイルの場所を文字列で指定します。
@param proc 通常、文字列を返す手続きオブジェクトを指定します。
# 例 dummy.rb の3行目から6 行目のトレース出力に !! をつける
require 'tracer'
Tracer.set_get_line_procs(......'./dummy.rb'){|line|
str = "\n"
str = "!!\n" if line >= 3 and line <= 6
str
}
Tracer.on
require 'dummy'
dm = Dummy.new
puts dm.number
=begin
# dummy.rb
class Dummy
def initialize
@number = 135
end
attr :number
end
=end...