種類
- インスタンスメソッド (66)
- モジュール関数 (22)
- 定数 (11)
モジュール
- Enumerable (11)
-
File
:: Constants (11) - Kernel (11)
- Process (11)
検索結果
先頭5件
-
String
# oct -> Integer (26175.0) -
文字列を 8 進文字列であると解釈して、整数に変換します。
...例][ruby]{
p "10".oct # => 8
p "010".oct # => 8
p "8".oct # => 0
//}
oct は文字列の接頭辞 ("0", "0b", "0B", "0x", "0X") に応じて
8 進以外の変換も行います。
//emlist[例][ruby]{
p "0b10".oct # => 2
p "10".oct # => 8
p "010".oct # => 8
p "0x10".oct # => 16
//}
整......ます。
符号や _ が含まれる場合も変換対象になります。
//emlist[例][ruby]{
p "-010".oct # => -8
p "-0x10".oct # => -16
p "-0b10".oct # => -2
p "1_0_1x".oct # => 65
//}
@see String#hex, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
逆に、数... -
File
:: Constants :: NOCTTY -> Integer (14102.0) -
自身がTTY制御しないようにTTYを開きます。 File.openで使用します。
自身がTTY制御しないようにTTYを開きます。
File.openで使用します。 -
IO
# ioctl(cmd , arg = 0) -> Integer (14102.0) -
IO に対してシステムコール ioctl を実行し、その結果を返します。 機能の詳細は ioctl(2) を参照してください。
...IO に対してシステムコール ioctl を実行し、その結果を返します。
機能の詳細は ioctl(2) を参照してください。
@param cmd IO に対するコマンドを整数で指定します。どのようなコマンドが使えるかはプラットフォームに依存し......ます。
@param arg cmd に対する引数を指定します。整数の時にはその値を ioctl に渡します。
文字列の場合には Array#pack した構造体だとみなして渡します。
arg が nil か false の場合には 0を、true の場合には 1 を... -
Process
. # setproctitle(title) -> String (14102.0) -
ps(1) が出力する現在実行中の Ruby スクリプトの名前を引数 title で指定した文字列に変更します。
...NotImplementedError
が発生する事はありません。本メソッドを実行しても $0 への影響はあ
りません。
Process.setproctitle('myapp: worker #%d' % worker_id)
本メソッドは 2.1 以降でグローバル変数を用いないで現在実行中の Ruby スク
リプ... -
Enumerable
# chunk {|elt| . . . } -> Enumerator (8008.0) -
要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。
...ADME") {|f|
f.chunk {|line|
line != sep || nil
}.each {|_, lines|
pp lines
}
}
#=> ["r20018 | knu | 2008-10-29 13:20:42 +0900 (Wed, 29 Oct 2008) | 2 lines\n",
# "\n",
# "* README, README.ja: Update the portability section.\n",
# "\n"]
# ["r16725 | knu | 2008-05-31 23:34:23 +... -
Kernel
. # Integer(arg , base = 0) -> Integer (8008.0) -
引数を整数(Fixnum,Bignum)に変換した結果を返します。
...teger("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid value for Integer: "hoge" (ArgumentError)
p Integer("") # `Integer': invalid value for Integer: "" (ArgumentError)
//}
@see String#hex,String#oct,String#to_i,Integer... -
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (8008.0) -
引数を整数(Fixnum,Bignum)に変換した結果を返します。
...teger("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid value for Integer: "hoge" (ArgumentError)
p Integer("") # `Integer': invalid value for Integer: "" (ArgumentError)
//}
@see String#hex,String#oct,String#to_i,Integer... -
String
# hex -> Integer (8008.0) -
文字列に 16 進数で数値が表現されていると解釈して整数に変換します。 接頭辞 "0x", "0X" とアンダースコアは無視されます。 文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。
..."0x10".hex # => 16
p "-0x10".hex # => -16
p "xyz".hex # => 0
p "10z".hex # => 16
p "1_0".hex # => 16
p "".hex # => 0
//}
@see String#oct, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
このメソッドの逆に数値を文字列に変換するには
Kernel.#sprintf,... -
String
# to _ f -> Float (8008.0) -
文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。
...# => Infinity
# warning: Float 10101010101010101010... out of range
//}
なお、このメソッドとは逆に、数値を文字列に変換するには
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
@see String#hex, String#oct, String#to_i,
Kernel.#Integer, Kernel.#Float... -
String
# to _ i(base = 10) -> Integer (8008.0) -
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
...する整数。0 か、2〜36 の整数。
@return 整数
このメソッドの逆に数値を文字列に変換するには、
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
String#hex, String#oct, String#to_f,
Kernel.#Integer, Kernel.#Float
も参照してください。...