ライブラリ
- ビルトイン (246)
- bigdecimal (12)
-
irb
/ cmd / help (12) -
irb
/ cmd / subirb (12) -
irb
/ context (12) -
json
/ add / exception (12) - mkmf (48)
-
net
/ http (12) -
net
/ smtp (24) -
rake
/ rdoctask (36) - resolv (24)
- rss (72)
クラス
- BigDecimal (12)
- Bignum (3)
-
CGI
:: Cookie (24) - Exception (44)
-
IRB
:: Context (12) -
IRB
:: ExtendCommand :: Help (12) -
IRB
:: ExtendCommand :: IrbCommand (12) - Integer (12)
- Module (24)
- NameError (24)
-
Net
:: SMTP (24) - NoMethodError (12)
- Numeric (12)
- Object (12)
-
RDoc
:: Options (24) -
RSS
:: Maker :: ChannelBase :: CategoriesBase :: CategoryBase (24) -
RSS
:: Rss :: Channel :: Cloud (24) -
RSS
:: Rss :: Channel :: Item :: Category (24) -
Rake
:: RDocTask (36) -
Resolv
:: DNS :: Name (12) -
Resolv
:: DNS :: Resource :: DomainName (12) -
RubyVM
:: InstructionSequence (36) - Thread (36)
-
Thread
:: Backtrace :: Location (36) - TracePoint (7)
-
WEBrick
:: Cookie (24)
モジュール
- Kernel (48)
-
Net
:: HTTPHeader (12)
キーワード
- args (12)
- autoload (12)
-
backtrace
_ locations (36) -
base
_ label (24) - domain (60)
- domain= (60)
- ehlo (12)
- execute (24)
-
find
_ library (24) -
have
_ library (24) - helo (12)
- inspect (12)
-
instruction
_ sequence (7) - label (12)
- main= (12)
-
main
_ page (12) -
main
_ page= (12) -
main
_ type (12) - name (24)
- raise (12)
- refine (12)
- remainder (39)
-
respond
_ to? (12) -
set
_ backtrace (12) -
subdomain
_ of? (12) -
to
_ a (12) -
to
_ json (12) -
to
_ s (24)
検索結果
先頭5件
-
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
attr_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
attr_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(含め...