るりまサーチ

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

別のキーワード

  1. fileutils options_of
  2. _builtin of
  3. objspace memsize_of
  4. objspace memsize_of_all
  5. object kind_of?

ライブラリ

キーワード

検索結果

<< < ... 26 27 28 >>

String#to_f -> Float (12.0)

文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。

...000).to_f # => Infinity
# warning: Float 10101010101010101010... out of range
//}

なお、このメソッドとは逆に、数値を文字列に変換するには
Kernel.#sprintf, String#%, Integer#to_s
を使用します。

@
see String#hex, String#oct, String#to_i,
Kernel.#Integer, Kernel...

SystemCallError.===(other) -> bool (12.0)

other が SystemCallError のサブクラスのインスタンスで、 かつ、other.errno の値が self::Errno と同じ場合に真を返します。そうでない場合は偽を返します。

...o の値が self::Errno と同じ場合に真を返します。そうでない場合は偽を返します。

従って、特に other が self.kind_of?(other) である場合には Module#=== と同様に真を返します。
その他に、 Errno::EXXX::Errno == Errno::EYYY::Errno である場合...
...か作られないようになりました。そのため現在はこのメソッドは実質上 Module#=== と同じ意味しかありません。

@
param other 任意のオブジェクト


p Errno::EAGAIN::Errno
p Errno::EWOULDBLOCK::Errno
begin
raise Errno::EAGAIN, "pseudo e...

Thread#[](name) -> object | nil (12.0)

name に対応したスレッドに固有のデータを取り出します。 name に対応するスレッド固有データがなければ nil を返し ます。

...たスレッドに固有のデータを取り出します。
name に対応するスレッド固有データがなければ nil を返し
ます。

@
param name スレッド固有データのキーを文字列か Symbol で指定します。

//emlist[例][ruby]{
[
Thread.new { Thread.current["nam...
....yield
}
}
meth(2) {
f.resume
}
f.resume
p Thread.current[:name]
# => nil if fiber-local
# => 2 if thread-local (The value 2 is leaked to outside of meth method.)
//}

Fiber を切り替えても同じ変数を返したい場合は
Thread#thread_variable_get と Thread#thread_variable_set
を使...

Time#httpdate -> String (12.0)

2616 で定義されている HTTP-date の rfc1123-date 形式の文字列を 返します。

...2616 で定義されている HTTP-date の rfc1123-date 形式の文字列を
返します。

@
return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss GMT
//}
注意: 結果はいつも UTC (GMT) です。

使用例
require 'time'

is...

Time#rfc2822 -> String (12.0)

2822 で定義されている date-time として表現される形式の文字列を 返します。

...2822 で定義されている date-time として表現される形式の文字列を
返します。

@
return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss zone
//}
ただし zone は [+-]hhmm です。
self が UTC time の場...

絞り込み条件を変える

Time#rfc822 -> String (12.0)

2822 で定義されている date-time として表現される形式の文字列を 返します。

...2822 で定義されている date-time として表現される形式の文字列を
返します。

@
return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss zone
//}
ただし zone は [+-]hhmm です。
self が UTC time の場...

WIN32OLE#ole_activex_initialize -> nil (12.0)

ActiveXコントロール用の初期化を行います。

...すべてエラーとなります。

@
raise WIN32OLERuntimeError オブジェクトがActiveXコントロールの永続化イ
ンターフェイスを持たない場合に通知します。

obj = WIN32OLE.new("ProgID_or_GUID_of_ActiveX_Control")
obj.ole_activex_i...

変数と定数 (12.0)

変数と定数 * local * instance * class * class_var_scope * global * pseudo * const * prio

...言は有効
p defined?(v) # => "local-variable"
p v # => nil
//}


===[a:instance] インスタンス変数

//emlist[例][ruby]{
@
foobar
//}

`@'で始まる変数はインスタンス変数であり、特定の
オブジェクトに所属しています。インスタンス変数は...
...ンスタンス変数を参照した時の値はnilです。


===[a:class] クラス変数

//emlist[例][ruby]{
class Foo
@
@foo = 1
def bar
puts @@foo
end
end
//}

@
@で始まる変数はクラス変数です。クラス変数はクラス定義
の中で定義され、クラスの特異...
...に例外 RuntimeError が発生します。

//emlist[][ruby]{
class Foo
end

class Bar < Foo
@
@v = :bar
end

class Foo
@
@v = :foo
end

class Bar
p @@v #=> RuntimeError (class variable @@v of Bar is overtaken by Foo)
end
//}


====[a:class_var_scope] クラス変数のスコープ

...
<< < ... 26 27 28 >>