るりまサーチ

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

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

検索結果

<< < ... 4 5 6 >>

NameError#to_s -> String (3013.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"
end...

Thread::Backtrace::Location#inspect -> String (3007.0)

Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。

...read::Backtrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。

//emlist[例][ruby]{
# foo.rb
class Foo
a
ttr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locati...
...ons.map do |call|
puts call.inspect
end

# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/to/foo.rb:9:in `<main>'"
//}...

Thread::Backtrace::Location#to_s -> String (3007.0)

self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。

...l.#caller と同じ表現にした文字列を返し
ます。

//emlist[例][ruby]{
# foo.rb
class Foo
a
ttr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end

# => path/to/foo.rb:5:in `initializ...
...e'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}...

TracePoint#instruction_sequence -> RubyVM::InstructionSequence (3007.0)

script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。

...eインスタンスを返します。

//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts 'hello'")
end
//}

@raise RuntimeError :script_compiled イベントのための...

Net::SMTP#ehlo(domain) -> Net::SMTP::Response (201.0)

EHLO コマンドを送ります(ESMTP を使います)。

...EHLO コマンドを送ります(ESMTP を使います)。

通常は Net::SMTP.start, Net::SMTP#start で EHLO が
送られるため利用する必要はないはずです。

@param domain EHLOで送るドメイン名...

絞り込み条件を変える

Net::SMTP#helo(domain) -> Net::SMTP::Response (201.0)

HELO コマンドを送ります(標準的な SMTP を使います)。

...HELO コマンドを送ります(標準的な SMTP を使います)。

通常は Net::SMTP.start, Net::SMTP#start で HELO が
送られるため利用する必要はないはずです。


@param domain HELOで送るドメイン名...

Module#refine(klass) { ... } -> Module (113.0)

引数 klass で指定したクラスまたはモジュールだけに対して、ブロックで指定した機能を提供で きるモジュールを定義します。定義した機能は Module#refine を使用せずに直 接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。 そのため、既存の機能を局所的に修正したい場合などに用いる事ができます。

...引数 klass で指定したクラスまたはモジュールだけに対して、ブロックで指定した機能を提供で
きるモジュールを定義します。定義した機能は Module#refine を使用せずに直
接 klass に対して変更を行う場合と異なり、限られた...
...ださい。

* https://magazine.rubyist.net/articles/0041/0041-200Special-refinement.html
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html

定義した機能は main.using, Module#using を実行した場合のみ
有効になります。

@param klass 拡張する対象のク...
...機能を持つ無名のモジュールを返します。

//emlist[例][ruby]{
class C
def foo
puts "C#foo"
end
end

module M
refine C do
def foo
puts "C#foo in M"
end
end
end

x = C.new
x.foo # => "C#foo"

using M

x = C.new
x.foo # => "C#foo in M"
//}

@see main.using...

Exception#to_json(*args) -> String (107.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\":\"ZeroDivi...
...sionError\",\"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...

Object#respond_to?(name, include_all = false) -> bool (107.0)

オブジェクトがメソッド name を持つとき真を返します。

...オブジェクトがメソッド name を持つとき真を返します。

オブジェクトが メソッド name を持つというのは、
オブジェクトが メソッド name に応答できることをいいます。

Windows での Process.fork や GNU/Linux での File.lchmod の
...
...うな NotImplementedError が発生する場合は false を返します。

※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライブラリなど、C言語で実装されているメソッドのみです。
Rubyで実装されたメ...
...す。

@param name Symbol または文字列で指定するメソッド名です。

@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。省略した場合
は false(含め...
<< < ... 4 5 6 >>