564件ヒット
[1-100件を表示]
(0.178秒)
ライブラリ
- ビルトイン (480)
- bigdecimal (24)
- fiddle (24)
- openssl (24)
- zlib (12)
クラス
- Array (348)
- BigDecimal (24)
-
Fiddle
:: Pointer (24) - Integer (24)
- Numeric (12)
- Object (24)
-
OpenSSL
:: BN (24) - Random (24)
- Range (36)
- String (12)
-
Zlib
:: GzipWriter (12)
キーワード
- % (12)
- * (24)
- [] (36)
- at (12)
- begin (12)
- combination (24)
- cycle (24)
-
delete
_ at (12) - fetch (12)
- first (48)
- flatten (12)
- flatten! (12)
- insert (12)
- last (12)
- permutation (24)
- pop (12)
-
public
_ method (12) - putc (12)
- rand (24)
-
repeated
_ combination (24) -
repeated
_ permutation (24) - sample (24)
- shift (24)
-
to
_ i (48)
検索結果
先頭5件
-
Numeric
# to _ int -> Integer (24336.0) -
self.to_i と同じです。
...self.to_i と同じです。
//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}... -
Object
# to _ int -> Integer (24308.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 (21303.0) -
self の小数点以下を切り捨てて整数に変換します。
...self の小数点以下を切り捨てて整数に変換します。
@raise FloatDomainError self が無限大や NaN であった場合に発生します。... -
Fiddle
:: Pointer # to _ int -> Integer (21303.0) -
自身が指すアドレスを整数で返します。
自身が指すアドレスを整数で返します。 -
OpenSSL
:: BN # to _ int -> Integer (21303.0) -
自身を Integer のインスタンスに変換します。
...自身を Integer のインスタンスに変換します。
@raise OpenSSL::BNError 変換に失敗した場合に発生します... -
Integer
# to _ int -> self (21209.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
10.to_i # => 10
//}... -
Object
# public _ method(name) -> Method (6113.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... -
Integer
# to _ i -> self (6109.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
10.to_i # => 10
//}... -
Array
# combination(n) -> Enumerator (6107.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...