別のキーワード
クラス
- Array (208)
- BasicObject (36)
- Binding (7)
- Complex (60)
- Data (6)
-
Encoding
:: Converter (192) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) -
Enumerator
:: Lazy (24) - Exception (128)
- Fiber (6)
- File (12)
- Float (36)
- Hash (24)
- IO (168)
- Integer (36)
- MatchData (4)
- Method (24)
- Module (195)
- Mutex (2)
- NilClass (36)
- Numeric (48)
- Object (120)
- Proc (18)
- Rational (309)
- Regexp (12)
-
RubyVM
:: InstructionSequence (130) - Set (12)
- SignalException (24)
- String (192)
- Struct (24)
- Thread (45)
-
Thread
:: Backtrace :: Location (84) -
Thread
:: ConditionVariable (20) -
Thread
:: Mutex (10) -
Thread
:: Queue (30) -
Thread
:: SizedQueue (30) - Time (86)
- TracePoint (19)
- UnboundMethod (24)
モジュール
- Enumerable (232)
キーワード
- * (12)
- ** (12)
- + (12)
- -@ (9)
-
/ (12) - <=> (12)
- == (24)
- === (12)
-
abort
_ on _ exception (12) - abs (9)
-
absolute
_ path (24) - autoload (12)
- autoload? (12)
- backtrace (12)
-
backtrace
_ locations (36) -
base
_ label (24) - broadcast (10)
- byteindex (3)
- capitalize (9)
- capitalize! (9)
- cause (12)
- ceil (12)
- clone (75)
- coerce (12)
-
collect
_ concat (36) - combination (24)
- concat (42)
- conj (24)
- conjugate (24)
-
const
_ added (3) -
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (12)
- convert (12)
- convpath (12)
- deconstruct (11)
-
deconstruct
_ keys (13) -
define
_ singleton _ method (24) - denominator (12)
-
deprecate
_ constant (12) - deq (20)
-
destination
_ encoding (12) - detect (24)
- disasm (12)
- disassemble (12)
- downcase (9)
- downcase! (9)
- dup (51)
- each (72)
-
each
_ cons (24) -
each
_ line (72) - encode (36)
- encode! (24)
-
error
_ bytes (12) -
error
_ char (12) - eval (12)
- exception (24)
- fdiv (12)
- fetch (12)
- find (24)
- finish (12)
-
first
_ lineno (12) -
flat
_ map (36) - flock (12)
- floor (12)
-
incomplete
_ input? (12) -
insert
_ output (12) - inspect (48)
-
instruction
_ sequence (7) - intersection (9)
- label (24)
-
last
_ error (12) - lineno (12)
- magnitude (9)
-
module
_ function (36) - mon (12)
- monday? (12)
- month (12)
- negative? (9)
- none? (53)
- nonzero? (12)
- numerator (12)
- one? (53)
- partition (36)
- path (24)
- permutation (24)
- pop (20)
- positive? (9)
-
primitive
_ convert (48) -
primitive
_ errinfo (12) -
private
_ constant (12) -
public
_ constant (12) - putback (24)
- quo (24)
- raise (6)
-
raised
_ exception (12) - rationalize (108)
-
remove
_ const (12) -
repeated
_ combination (24) -
repeated
_ permutation (24) - replacement (12)
- replacement= (12)
-
report
_ on _ exception (9) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - round (12)
- rpartition (12)
-
ruby2
_ keywords (18) -
set
_ backtrace (12) - shift (20)
- signal (10)
- signm (12)
- signo (12)
-
singleton
_ class (12) -
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
slice
_ before (24) -
source
_ encoding (12) -
source
_ location (43) - strftime (12)
- subsec (12)
- swapcase (9)
- swapcase! (9)
- synchronize (12)
-
to
_ a (18) -
to
_ binary (10) -
to
_ f (12) -
to
_ i (12) -
to
_ r (84) -
to
_ s (36) - truncate (12)
- union (10)
- upcase (9)
- upcase! (9)
- values (6)
- zone (12)
検索結果
先頭5件
- Rational
# -(other) -> Rational | Float - Thread
# report _ on _ exception -> bool - Thread
# abort _ on _ exception -> bool - Module
# const _ source _ location(name , inherited = true) -> [String , Integer] - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol
-
Rational
# -(other) -> Rational | Float (21221.0) -
差を計算します。
...差を計算します。
@param other 自身から引く数
other に Float を指定した場合は、計算結果を Float で返しま
す。
//emlist[例][ruby]{
r = Rational(3, 4)
r - 1 # => (-1/4)
r - 0.5 # => 0.25
//}... -
Thread
# report _ on _ exception -> bool (12347.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...ad.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => tr......:1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread......:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# abort _ on _ exception -> bool (12329.0) -
真の場合、そのスレッドが例外によって終了した時に、インタプリタ 全体を中断させます。false の場合、あるスレッドで起こった例 外は、Thread#join などで検出されない限りそのスレッ ドだけをなにも警告を出さずに終了させます。
...ionを参照してください。
@param newstate 自身を実行中に例外発生した場合、インタプリタ全体を終了させるかどうかを true か false で指定します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.abort_on_exception # => false
thread.abort_on......_exception = true
thread.abort_on_exception # => true
//}... -
Module
# const _ source _ location(name , inherited = true) -> [String , Integer] (12309.0) -
name で指定した定数の定義を含むソースコードのファイル名と行番号を配列で返します。
...//emlist[例][ruby]{
# test.rb:
class A # line 1
C1 = 1
C2 = 2
end
module M # line 6
C3 = 3
end
class B < A # line 10
include M
C4 = 4
end
class A # 継続して A を定義する
C2 = 8 # 定数を再定義する
end
p B.const_source_location('C4') # =......p B.const_source_location('C3') # => ["test.rb", 7]
p B.const_source_location('C1') # => ["test.rb", 2]
p B.const_source_location('C3', false) # => nil -- include したモジュールは検索しない
p A.const_source_location('C2') # => ["test.rb", 16] -- 最......す
p Object.const_source_location('B') # => ["test.rb", 10] -- Object はトップレベルの定数を検索する
p Object.const_source_location('A') # => ["test.rb", 1] -- クラスが再定義された場合は最初の定義位置を返す
p B.const_source_location('A')... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (9621.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...coding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesiz......ram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after o......ing::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (9521.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...coding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesiz......ram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after o......ing::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (9421.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...coding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesiz......ram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after o......ing::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (9321.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...coding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesiz......ram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after o......ing::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (9315.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return......if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "t......est.rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace...