るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Enumerator::ArithmeticSequence#begin -> Numeric (21102.0)

初項 (始端) を返します。

...初項 (始端) を返します。

@see Enumerator::ArithmeticSequence#end...

Enumerator::ArithmeticSequence#begin -> Numeric | nil (21102.0)

初項 (始端) を返します。

...初項 (始端) を返します。

@see Enumerator::ArithmeticSequence#end...

Range#begin -> object (18137.0)

始端の要素を返します。 始端を持たない範囲オブジェクトの場合、begin はnilを返しますが, first は例外 RangeError が発生します。

...ェクトの場合、begin はnilを返しますが, first は例外 RangeError が発生します。

//emlist[例][ruby]{
# 始端を持つ場合
p (1..5).begin # => 1
p (1..0).begin # => 1
p (1..5).first # => 1
p (1..0).first # => 1

# 始端を持たない場合
p (..5).begin #=> nil
p (..5).fir...

Exception#to_json(*args) -> String (6144.0)

自身を JSON 形式の文字列に変換して返します。

...してから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。

@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。

//emlist[例][ruby]{
require "json/add/core"

begin

0/0
rescue => e
e.to_json # => "{\"json_class\...
...":\"ZeroDivisionError\",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}

@see JSON::Generator::GeneratorMethods::Hash#to_json...

NameError#to_s -> String (6114.0)

例外オブジェクトを文字列に変換して返します。

...例外オブジェクトを文字列に変換して返します。

例:

begin

foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.to_s # => "undefined local variable or method `foobar' for main:Object"...

絞り込み条件を変える

UncaughtThrowError#to_s -> String (6114.0)

self を tag を含む文字列表現にして返します。

...self を tag を含む文字列表現にして返します。

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

begin

do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//}...

Exception#to_s -> String (3108.0)

エラーメッセージをあらわす文字列を返します。

...エラーメッセージをあらわす文字列を返します。

//emlist[例][ruby]{
begin

1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}...

Range#first -> object (3037.0)

始端の要素を返します。 始端を持たない範囲オブジェクトの場合、begin はnilを返しますが, first は例外 RangeError が発生します。

...ェクトの場合、begin はnilを返しますが, first は例外 RangeError が発生します。

//emlist[例][ruby]{
# 始端を持つ場合
p (1..5).begin # => 1
p (1..0).begin # => 1
p (1..5).first # => 1
p (1..0).first # => 1

# 始端を持たない場合
p (..5).begin #=> nil
p (..5).fir...

StopIteration#result -> object (3013.0)

この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。

...ect = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end

enumerator = object.to_enum

p enumerator.next #=> :yield1
p enumerator.next #=> :yield2

begin

enumerator.next
rescue StopIteration => error
p error.result #=> :each_returned
end...

Range#first(n) -> [object] (3012.0)

最初の n 要素を返します。範囲内に要素が含まれない場合は空の配列を返します。

...を返します。

@param n 取得する要素数を整数で指定します。整数以外のオブジェクトを指定
した場合は to_int メソッドによる暗黙の型変換を試みます。

@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジ...

絞り込み条件を変える

<< 1 2 3 ... > >>