447件ヒット
[1-100件を表示]
(0.147秒)
別のキーワード
種類
- インスタンスメソッド (341)
- モジュール関数 (33)
- 文書 (26)
- 特異メソッド (25)
- 関数 (22)
ライブラリ
- ビルトイン (344)
- bigdecimal (22)
- openssl (22)
- zlib (11)
クラス
- Array (220)
- BigDecimal (22)
- Integer (3)
- Object (22)
-
OpenSSL
:: BN (22) - Range (33)
- SignalException (22)
- String (11)
-
Zlib
:: GzipWriter (11)
モジュール
- Kernel (33)
キーワード
- % (11)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Integer (11)
-
NEWS for Ruby 3
. 0 . 0 (4) - [] (33)
- at (11)
- begin (11)
- combination (22)
- cycle (22)
-
delete
_ at (11) - fetch (11)
- first (33)
- format (11)
- insert (11)
- last (11)
- new (22)
- permutation (11)
- pop (11)
-
public
_ method (11) - putc (11)
-
rb
_ to _ int (11) -
rb
_ to _ integer (11) -
repeated
_ combination (22) - sample (22)
- shift (11)
- sprintf (11)
- sprintf フォーマット (11)
-
to
_ i (22) -
try
_ convert (3)
検索結果
先頭5件
-
Object
# to _ int -> Integer (27319.0) -
オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。
説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必......が使われるすべての場面で代置可能であるような、
* 整数そのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_int
1
end
end
ary = [:a, :b, :c]
p(ary[Foo.new]) # => :b
//}
@see Kernel.#Integer... -
BigDecimal
# to _ int -> Integer (24302.0) -
self の小数点以下を切り捨てて整数に変換します。
...self の小数点以下を切り捨てて整数に変換します。
@raise FloatDomainError self が無限大や NaN であった場合に発生します。... -
OpenSSL
:: BN # to _ int -> Integer (24302.0) -
自身を Integer のインスタンスに変換します。
...自身を Integer のインスタンスに変換します。
@raise OpenSSL::BNError 変換に失敗した場合に発生します... -
Integer
. try _ convert(obj) -> Integer | nil (23228.0) -
obj を Integer に変換しようと試みます。変換には Object#to_int メソッドが使われます。
...obj を Integer に変換しようと試みます。変換には Object#to_int
メソッドが使われます。
Integer ならそのままobjを返します。
そうでなければ obj.to_int の結果を返すか、nil が返されます。
@param obj 変換する任意のオブジェクト......@return Integer または nil
@raise TypeError to_int が Integer を返さなかった場合に発生します。
//emlist[例][ruby]{
Integer.try_convert(1) # => 1
Integer.try_convert(1.25) # => 1
Integer.try_convert([]) # => nil
//}... -
VALUE rb
_ to _ int(VALUE val) (18316.0) -
val を to_int メソッドを使って Ruby の整数に変換します。
...val を to_int メソッドを使って Ruby の整数に変換します。... -
static VALUE rb
_ to _ integer(VALUE val , char *method) (18300.0) -
-
Object
# public _ method(name) -> Method (12212.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...トの public メソッド name をオブジェクト化した
Method オブジェクトを返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソ......ッド名を引数として与えると発生します。
//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method `p' for class `Integer' is private (NameError)
//}
@see Object#method,Object#public_send,Module#public_instance_method... -
Array
# combination(n) -> Enumerator (12206.0) -
サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
...場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
a.combination(1).to_......2],[3],[4]]
a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
a.combination(4).to_a #=> [[1,2,3,4]]
a.combination(0).to_a #=> [[]]: one combination of length 0
a.combination(5).to_a #=> [] : no combinations of length 5
/......た配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
result = []
a.combination(2) {|e| result << e} # => [1,2,3,4]
result #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
//}
@see Array#permutation, Array#repeated_combination... -
Array
# combination(n) {|c| block } -> self (12206.0) -
サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
...場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
a.combination(1).to_......2],[3],[4]]
a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
a.combination(4).to_a #=> [[1,2,3,4]]
a.combination(0).to_a #=> [[]]: one combination of length 0
a.combination(5).to_a #=> [] : no combinations of length 5
/......た配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
result = []
a.combination(2) {|e| result << e} # => [1,2,3,4]
result #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
//}
@see Array#permutation, Array#repeated_combination... -
Array
# repeated _ combination(n) -> Enumerator (12206.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3]
a.repeated_combination(1).......> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,......a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| resu...