るりまサーチ

最速Rubyリファレンスマニュアル検索!
154件ヒット [1-100件を表示] (0.102秒)

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

検索結果

<< 1 2 > >>

Kernel.#Integer(arg, base = 0) -> Integer (18464.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...o_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # c...
...nvert 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") #=> 10
p Integer("010") #=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10")...
...れる
p Integer("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_...

Kernel.#Integer(arg, base = 0, exception: true) -> Integer | nil (18464.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...o_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # c...
...nvert 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") #=> 10
p Integer("010") #=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10")...
...れる
p Integer("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_...

String#oct -> Integer (18404.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
//}

...
...t[例][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

逆に、数値を文字列に変換するにはKernel.#sprintf,
String#%, Integer#to_s を使用...

CSV#ioctl(cmd, arg = 0) -> Integer (6301.0)

IO#ioctl に委譲します。

...IO#ioctl に委譲します。


@see IO#ioctl...

Fcntl::O_NOCTTY -> Integer (6301.0)

開いたファイルが端末デバイスでも、制御端末にはなりません。

開いたファイルが端末デバイスでも、制御端末にはなりません。

絞り込み条件を変える

File::Constants::NOCTTY -> Integer (6301.0)

自身がTTY制御しないようにTTYを開きます。 File.openで使用します。

自身がTTY制御しないようにTTYを開きます。
File.openで使用します。

IO#ioctl(cmd, arg = 0) -> Integer (6301.0)

IO に対してシステムコール ioctl を実行し、その結果を返します。 機能の詳細は ioctl(2) を参照してください。

...IO に対してシステムコール ioctl を実行し、その結果を返します。
機能の詳細は ioctl(2) を参照してください。

@param cmd IO に対するコマンドを整数で指定します。どのようなコマンドが使えるかはプラットフォームに依存し...
...ます。

@param arg cmd に対する引数を指定します。整数の時にはその値を ioctl に渡します。
文字列の場合には Array#pack した構造体だとみなして渡します。
arg が nil か false の場合には 0を、true の場合には 1 を...

OpenSSL::ASN1::OCTET_STRING -> Integer (6301.0)

ASN.1 UNIVERSAL タグの、 OCTET_STRING のタグ番号 4 を表す定数です。

...ASN.1 UNIVERSAL タグの、
OCT
ET_STRING のタグ番号 4 を表す定数です。...

1.6.8から1.8.0への変更点(まとめ) (2550.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...作はなくなりました)

$defout や $deferr に代入を行うと警告がでます。
(注:1.6 に $deferr はありません)
((<ruby-dev:20961>))

$stdin にオブジェクトを代入すると標準入力からの入力メソッド(gets 等)
はそのオブジェクトにメソ...
...prefix として 0d が追加されました。
8進リテラルの prefix として 0 以外に 0o が追加されました。

Integer
(), String#to_i、String#oct もこの prefix を認識します。

: ((<メソッド引数の & 修飾|メソッド呼び出し/イテレータ>)) [compat]
:...
...

: 終了ステータス [compat]

raise SystemExit したときに終了ステータス 1 で終了するようになりました。
((<ruby-dev:16776>))

: ((<"rescue/ensure on begin .. end while"|制御構造/while 修飾子>)) [compat]

rescue/ensure を持つ begin 式も while/until...

ruby 1.8.4 feature (1632.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更もこちら
* [change]: 変更されたクラス/メソッドなど(互換...
...=> ruby 1.8.4 (2005-12-16) [i686-linux]
-
:1: empty symbol literal

p :"#{""}"

# => ruby 1.8.3 (2005-09-21) [i686-linux]
:
# => ruby 1.8.4 (2005-12-16) [i686-linux]
-
:1: empty symbol literal

: Symbol [bug]

#Sat Oct 22 13:26:57 2005 N...
...z@ruby-lang.org>
#
# * eval.c (set_trace_func): add rb_secure(4) to prevent adding
# tracing function.

$SAFE=4でtrace_funcの追加を禁止。

: printf [bug]

#Wed Dec 7 15:31:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * sprintf.c (rb_str_format): integer over...

絞り込み条件を変える

String#hex -> Integer (273.0)

文字列に 16 進数で数値が表現されていると解釈して整数に変換します。 接頭辞 "0x", "0X" とアンダースコアは無視されます。 文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。

...ます。
文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。

self が空文字列のときは 0 を返します。

//emlist[例][ruby]{
p "10".hex # => 16
p "ff".hex # => 255
p "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#%,
Integer
#to_s
などを使ってください。...
<< 1 2 > >>