るりまサーチ

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

別のキーワード

  1. _builtin begin
  2. range begin
  3. matchdata begin
  4. arithmeticsequence begin
  5. begin

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Enumerator::ArithmeticSequence#hash -> Integer (18108.0)

自身のハッシュ値を返します。

...自身のハッシュ値を返します。

begin
, end, step, exclude_end? が等しい Enumerable::ArithmeticSequence は
同じハッシュ値を返します。...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (108.0)

key ヘッダフィールドを返します。

...Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'

begin

req.fetch("content-length")
rescue => e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ru...

Exception#to_json(*args) -> String (25.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...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer) -> Symbol (13.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...am options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after ou...
...source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin

ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (13.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...am options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after ou...
...source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin

ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (13.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...am options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after ou...
...source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin

ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (13.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...am options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after ou...
...source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin

ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec...

KeyError#key -> object (13.0)

KeyError の原因となったメソッド呼び出しのキーを返します。

...ソッド呼び出しのキーを返します。

@raise ArgumentError キーが設定されていない時に発生します。

例:

h = Hash.new
begin

h.fetch('gumby'*20)
rescue KeyError => e
p e.message # => "key not found: \"gumbygumbygumbygumbygumbygumbygumbygumbygumb...

KeyError#receiver -> object (13.0)

KeyError の原因となったメソッド呼び出しのレシーバを返します。

...び出しのレシーバを返します。

@raise ArgumentError レシーバが設定されていない時に発生します。

例:

h = Hash.new
begin

h.fetch('gumby'*20)
rescue KeyError => e
p e.message # => "key not found: \"gumbygumbygumbygumbygumbygumbygumbygumbygum...

Net::HTTPHeader#fetch(key) -> String (8.0)

key ヘッダフィールドを返します。

...Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'

begin

req.fetch("content-length")
rescue => e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ru...

絞り込み条件を変える

<< 1 2 > >>