784件ヒット
[1-100件を表示]
(0.134秒)
別のキーワード
種類
- インスタンスメソッド (588)
- モジュール関数 (96)
- 特異メソッド (64)
- 文書 (24)
- 関数 (12)
クラス
- Array (408)
-
Fiddle
:: Pointer (24) - Integer (28)
- Numeric (12)
- Object (24)
- Random (36)
- Range (72)
- SignalException (36)
- String (12)
モジュール
- Kernel (96)
キーワード
- % (12)
- * (24)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Integer (12)
- [] (36)
- []= (24)
- at (12)
- begin (12)
- combination (24)
- cycle (12)
-
delete
_ at (12) - end (12)
- fetch (36)
- first (48)
- flatten (12)
- flatten! (12)
- format (12)
- insert (12)
- last (48)
- new (36)
- permutation (24)
- pop (12)
-
public
_ method (12) - putc (12)
- rand (60)
-
rb
_ to _ int (12) -
repeated
_ combination (24) -
repeated
_ permutation (24) - rotate (12)
- rotate! (12)
- sample (24)
- shift (24)
- sprintf (12)
- sprintf フォーマット (12)
- srand (24)
-
to
_ i (12) -
to
_ ptr (12) -
try
_ convert (4)
検索結果
先頭5件
-
Numeric
# to _ int -> Integer (24225.0) -
self.to_i と同じです。
...self.to_i と同じです。
//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}... -
Object
# to _ int -> Integer (24219.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... -
Integer
# to _ int -> self (21213.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
10.to_i # => 10
//}... -
VALUE rb
_ to _ int(VALUE val) (12248.0) -
val を to_int メソッドを使って Ruby の整数に変換します。
...val を to_int メソッドを使って Ruby の整数に変換します。... -
Kernel
. # format(format , *arg) -> String (6502.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...ormat 文字列を C 言語の sprintf と同じように解釈し、
引数をフォーマットした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf......フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。ただし、short や long などの C 特有の型に対する修飾子が
ないこと、2進数の指示子(%b, %B)が存在すること、sprintf のすべての方言をサ......ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるので)
..f のような表示をします。絶対値に符号を付... -
Kernel
. # sprintf(format , *arg) -> String (6502.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...ormat 文字列を C 言語の sprintf と同じように解釈し、
引数をフォーマットした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf......フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。ただし、short や long などの C 特有の型に対する修飾子が
ないこと、2進数の指示子(%b, %B)が存在すること、sprintf のすべての方言をサ......ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるので)
..f のような表示をします。絶対値に符号を付... -
sprintf フォーマット (6402.0)
-
sprintf フォーマット === sprintf フォーマット
...sprintf フォーマット === sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。ただし、short や long などの C 特有の型に対する修飾子が
ないこと、2進数の指示子(%b, %B)が存在すること......、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるので)
..f のような表示......はプレフィックスが付加されません。
//emlist[][ruby]{
p sprintf("%#b", 10) #=> "0b1010"
p sprintf("%#B", 10) #=> "0B1010"
p sprintf("%#b", 0) #=> "0"
p sprintf("%#o", 10) #=> "012"
p sprintf("%#x", 10) #=> "0xa"
p sprintf("%#X", 10) #=> "0XA"
//}
浮動小数点数 (f, e, E, g, G... -
Kernel
. # Integer(arg , base = 0) -> Integer (6242.0) -
引数を整数 (Fixnum,Bignum) に変換した結果を返します。
...頭辞を含む整数表現とみなせる文字列のみ
変換します。
数値と文字列以外のオブジェクトに対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2か......aise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{......p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)
p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10"... -
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (6242.0) -
引数を整数 に変換した結果を返します。
...頭辞を含む整数表現とみなせる文字列のみ
変換します。
数値と文字列以外のオブジェクトに対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2か......aise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{......p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)
p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10"... -
Object
# public _ method(name) -> Method (6224.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...thod オブジェクトを返します。
@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...