るりまサーチ

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

別のキーワード

  1. kernel spawn
  2. kernel exec
  3. kernel system
  4. kernel open
  5. kernel fail

ライブラリ

キーワード

検索結果

<< < ... 16 17 18 19 > >>

UncaughtThrowError#tag -> object (23.0)

Kernel.#throw に指定した tag を返します。

...
Kernel
.#throw に指定した tag を返します。

//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p
ex.tag # => ":uncaught_label"
end
//}...

UncaughtThrowError#value -> object (23.0)

Kernel.#throw に指定した value を返します。

...
Kernel
.#throw に指定した value を返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p
ex.value # => "uncaught_value"
end
//}...

Module#remove_const(name) -> object (19.0)

name で指定した定数を取り除き、その定数に設定されていた値を 返します。

...name で指定した定数を取り除き、その定数に設定されていた値を
返します。

@param name String または Symbol を指定します。

@return 引数で指定された定数に設定されていた値を返します。

@raise NameError 引数で指定された定数が...
...発生します。

//emlist[例][ruby]{
class Foo
FOO = 1
p
remove_const(:FOO) # => 1
p
FOO # => uninitialized constant FOO at Foo (NameError)
end
//}

組み込みクラス/モジュールを設定している定数や Kernel.#autoload を指定した(まだロードしてない)定...

Object#instance_variables -> [Symbol] (19.0)

オブジェクトのインスタンス変数名をシンボルの配列として返します。

...列として返します。

//emlist[][ruby]{
obj = Object.new
obj.instance_eval { @foo, @bar = nil }
p
obj.instance_variables

#=> [:@foo, :@bar]
//}

@see Object#instance_variable_get, Kernel.#local_variables, Kernel.#global_variables, Module.constants, Module#constants, Module#class_variables...

Object#method(name) -> Method (19.0)

オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。

...トを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//emlist[][ruby]{
me = -365.method(:abs)
p
me #=> #<Method: Integer#abs>
p
me.call #=> 365
//}

@...
...see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#singleton_method...

絞り込み条件を変える

SystemExit#status -> Integer (19.0)

例外オブジェクトに保存された終了ステータスを返します。

...します。

終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。

例:

begin
exit 1
rescue SystemExit => err
p
err.status # => 1
end

begin
raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p
err.status # => 1
end...

Object#to_ary -> Array (13.0)

オブジェクトの Array への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。

...すべての場面で代置可能であるような、
* 配列そのものとみなせるようなもの
という厳しいものになっています。

//emlist[][ruby]{
class Foo
def to_ary
[3,4]
end
end

it = Foo.new
p
([1,2] + it) #=> [1, 2, 3, 4]
//}

@see Object#to_a,Kernel.#Array...

Object#to_int -> Integer (13.0)

オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。

...が使われるすべての場面で代置可能であるような、
* 整数そのものとみなせるようなもの
という厳しいものになっています。

//emlist[][ruby]{
class Foo
def to_int
1
end
end

ary = [:a, :b, :c]
p
(ary[Foo.new]) # => :b
//}

@see Kernel.#Integer...

Object#to_str -> String (13.0)

オブジェクトの String への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。

...面で代置可能であるような、
* 文字列そのものとみなせるようなもの
という厳しいものになっています。

//emlist[][ruby]{
class Foo
def to_str
'Edition'
end
end

it = Foo.new
p
('Second' + it) #=> "SecondEdition"
//}

@see Object#to_s,Kernel.#String...
<< < ... 16 17 18 19 > >>