ライブラリ
- ビルトイン (13)
- bigdecimal (1)
-
json
/ add / exception (1) -
net
/ http (1) -
rake
/ rdoctask (1) - rss (4)
クラス
- BigDecimal (1)
- Bignum (1)
-
CGI
:: Cookie (2) - Exception (2)
- Integer (1)
- Module (1)
- NameError (1)
- NoMethodError (1)
-
RDoc
:: Options (2) -
RSS
:: Maker :: ChannelBase :: CategoriesBase :: CategoryBase (2) -
RSS
:: Rss :: Channel :: Item :: Category (2) -
Rake
:: RDocTask (1) -
RubyVM
:: InstructionSequence (2) - Thread (2)
-
Thread
:: Backtrace :: Location (3) -
WEBrick
:: Cookie (1)
モジュール
-
Net
:: HTTPHeader (1)
キーワード
- args (1)
-
backtrace
_ locations (2) -
base
_ label (2) - domain (4)
- domain= (3)
- inspect (1)
- label (1)
-
main
_ page (1) -
main
_ page= (1) -
main
_ type (1) - remainder (3)
-
set
_ backtrace (1) -
to
_ json (1) -
to
_ s (2) - using (1)
検索結果
先頭5件
-
Rake
:: RDocTask # main -> String (72907.0) -
メインとして使用されるファイル名を返します。
メインとして使用されるファイル名を返します。 -
RDoc
:: Options # main _ page -> String | nil (54955.0) -
コマンドライン引数の --main オプションで指定したファイル名、クラス/モ ジュール名を返します。
コマンドライン引数の --main オプションで指定したファイル名、クラス/モ
ジュール名を返します。
指定しなかった場合は nil を返します。 -
RDoc
:: Options # main _ page=(val) (54955.0) -
コマンドライン引数の --main オプションと同様の指定を行います。
コマンドライン引数の --main オプションと同様の指定を行います。
@param val 設定するファイル名、クラス/モジュール名を文字列で指定します。 -
RSS
:: Maker :: ChannelBase :: CategoriesBase :: CategoryBase # domain (54604.0) -
@todo
@todo -
RSS
:: Maker :: ChannelBase :: CategoriesBase :: CategoryBase # domain=() (54604.0) -
@todo
@todo -
BigDecimal
# remainder(n) -> BigDecimal (45973.0) -
self を n で割った余りを返します。
self を n で割った余りを返します。
@param n self を割る数を指定します。
//emlist[][ruby]{
require 'bigdecimal'
x = BigDecimal((2**100).to_s)
x.remainder(3).to_i # => 1
(-x).remainder(3).to_i # => -1
x.remainder(-3).to_i # => 1
(-x).remainder(-3).to_i # => -1
//}
戻り値は self と同じ符号になります。これは BigDecimal#% とは異な
る点に注意し... -
Bignum
# remainder(other) -> Fixnum | Bignum | Float (45904.0) -
self を other で割った余り r を返します。
self を other で割った余り r を返します。
r の符号は self と同じになります。
@param other self を割る数。
@see Bignum#divmod, Bignum#modulo, Numeric#modulo -
CGI
:: Cookie # domain -> String (45904.0) -
クッキーを適用するドメインを返します。
クッキーを適用するドメインを返します。 -
CGI
:: Cookie # domain=(value) (45604.0) -
クッキーを適用するドメインをセットします。
クッキーを適用するドメインをセットします。
@param value ドメインを指定します。 -
Integer
# remainder(other) -> Numeric (45604.0) -
self を other で割った余り r を返します。
self を other で割った余り r を返します。
r の符号は self と同じになります。
@param other self を割る数。
//emlist[][ruby]{
5.remainder(3) # => 2
-5.remainder(3) # => -2
5.remainder(-3) # => 2
-5.remainder(-3) # => -2
-1234567890987654321.remainder(13731) # => -6966
-1234567890987654321.remainder(13731.24) #... -
RSS
:: Rss :: Channel :: Item :: Category # domain (45604.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Category # domain= (45604.0) -
@todo
@todo -
Net
:: HTTPHeader # main _ type -> String|nil (36925.0) -
"text/html" における "text" のようなタイプを表す 文字列を返します。
"text/html" における "text" のようなタイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//} -
WEBrick
:: Cookie # domain -> String (36904.0) -
ドメイン名を文字列で表すアクセサです。
ドメイン名を文字列で表すアクセサです。
@param value ドメイン名を表す文字列を指定します。 -
Module
# using(module) -> self (36622.0) -
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有
効にします。
有効にした拡張の有効範囲については以下を参照してください。
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
@see Module#refine, main.using -
NoMethodError
# args -> [object] (27322.0) -
メソッド呼び出しに使われた引数を配列で返します。
メソッド呼び出しに使われた引数を配列で返します。
例:
begin
foobar(1,2,3)
rescue NoMethodError
p $!
p $!.name
p $!.args
end
# => #<NoMethodError: undefined method `foobar' for main:Object>
:foobar
[1, 2, 3] -
RubyVM
:: InstructionSequence # label -> String (18640.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: R... -
Exception
# to _ json(*args) -> String (18622.0) -
自身を JSON 形式の文字列に変換して返します。
自身を 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\":\"ZeroDivis... -
RubyVM
:: InstructionSequence # base _ label -> String (18622.0) -
self が表す命令シーケンスの基本ラベルを返します。
self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "h... -
Thread
# backtrace _ locations(range) -> [Thread :: Backtrace :: Location] | nil (18622.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
スレッドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@param range 取得したいフレームの範囲を示す Range オブジェクトを指定します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]... -
Thread
# backtrace _ locations(start = 0 , length = nil) -> [Thread :: Backtrace :: Location] | nil (18622.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
スレッドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@param range 取得したいフレームの範囲を示す Range オブジェクトを指定します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]... -
Thread
:: Backtrace :: Location # inspect -> String (18622.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
Thread::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).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in ... -
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (9640.0) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
バックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。
@param errinfo nil、String あるいは String の配列のいずれかを指定します。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
$!.backtrace # => ["/path/to/test.rb:5:in `rescue in <main>'", "/path/to/test.rb:2:in `<main>'"]
$!.se... -
NameError
# to _ s -> String (9640.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 # base _ label -> String (9622.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
self が表すフレームの基本ラベルを返します。通常、
Thread::Backtrace::Location#label から修飾を取り除いたもので構成
されます。
//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.base_label
end
# => init... -
Thread
:: Backtrace :: Location # to _ s -> String (9622.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
self が表すフレームを Kernel.#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 `initialize'
# path/to/foo...