るりまサーチ

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

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

検索結果

SystemCallError.new(errno) -> SystemCallError (18125.0)

整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。

... SystemCallError の直接のインスタンスではなく、サブクラスのインスタンスです。
それらのサブクラスは Errno モジュール内に定義されています。
対応するサブクラスが存在しないコードを与えた場合には、 SystemCallError...
...ときに発生します。

例:

p SystemCallError.new("message", 2)
# => #<Errno::ENOENT: No such file or directory - message>
p SystemCallError.new(2)
# => #<Errno::ENOENT: No such file or directory>
p SystemCallError.new(256)
# => #<SystemCallError: Unknown error 256>...

SystemCallError.new(error_message, errno) -> SystemCallError (18125.0)

整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。

... SystemCallError の直接のインスタンスではなく、サブクラスのインスタンスです。
それらのサブクラスは Errno モジュール内に定義されています。
対応するサブクラスが存在しないコードを与えた場合には、 SystemCallError...
...ときに発生します。

例:

p SystemCallError.new("message", 2)
# => #<Errno::ENOENT: No such file or directory - message>
p SystemCallError.new(2)
# => #<Errno::ENOENT: No such file or directory>
p SystemCallError.new(256)
# => #<SystemCallError: Unknown error 256>...

SystemCallError.new(error_message) -> SystemCallError (18115.0)

SystemCallError オブジェクトを生成して返します。

...SystemCallError オブジェクトを生成して返します。

@param error_message エラーメッセージを表す文字列

例:

p SystemCallError.new("message")
# => #<SystemCallError: unknown error - message>...

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

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

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

従って、特に other が self.kind_of?(other) である場合には Module#=== と同様に真...
...を返します。
その他に、 Errno::EXXX::Errno == Errno::EYYY::Errno である場合にも Errno::EXXX == Errno::EYYY.new は真を返します。

エラー名は異なるがエラーコードは同じであるような Errno::EXXX 例外をまとめて捕捉するために Module#=== を上...