クラス
-
ARGF
. class (11) - Array (437)
- BasicObject (22)
- Bignum (6)
- Binding (54)
- Complex (11)
- Data (2)
-
Encoding
:: Converter (110) -
Encoding
:: InvalidByteSequenceError (77) - Enumerator (27)
-
Enumerator
:: Lazy (51) -
Enumerator
:: Yielder (11) - Fiber (3)
- File (14)
-
File
:: Stat (77) - Fixnum (6)
- Float (21)
- Hash (257)
- IO (11)
- Integer (16)
- LocalJumpError (11)
- MatchData (11)
- Module (203)
- NameError (15)
- NoMethodError (22)
- Numeric (29)
- Object (88)
- Range (41)
- Rational (38)
- Regexp (11)
- RubyVM (12)
-
RubyVM
:: AbstractSyntaxTree :: Node (36) -
RubyVM
:: InstructionSequence (159) - String (176)
- Struct (97)
- Thread (111)
-
Thread
:: ConditionVariable (36) -
Thread
:: Queue (27) - Time (11)
- TracePoint (28)
- UnboundMethod (10)
- UncaughtThrowError (10)
モジュール
- Enumerable (399)
- FileTest (11)
- GC (16)
- Kernel (260)
- Marshal (22)
- Process (33)
-
Process
:: GID (33) -
Process
:: UID (33) -
RubyVM
:: AbstractSyntaxTree (12) -
RubyVM
:: MJIT (18)
キーワード
-
$ -v (11) -
$ -w (11) -
$ VERBOSE (11) - << (20)
-
CLOCK
_ VIRTUAL (11) - ConditionVariable (18)
- DEBUG= (11)
-
DEFAULT
_ PARAMS (11) - EADDRNOTAVAIL (11)
- EINVAL (11)
- ENAVAIL (11)
- ENOTRECOVERABLE (11)
- EOVERFLOW (11)
- EPROCUNAVAIL (11)
- EPROGUNAVAIL (11)
- InvalidByteSequenceError (11)
- Lazy (9)
-
MAJOR
_ VERSION (11) -
MINOR
_ VERSION (11) -
MUTEX
_ FOR _ THREAD _ EXCLUSIVE (5) -
RLIM
_ SAVED _ CUR (11) -
RLIM
_ SAVED _ MAX (11) -
RUBY
_ PATCHLEVEL (11) - []= (132)
- ` (11)
-
absolute
_ path (11) - alive? (14)
- all? (47)
- any? (56)
- argv (11)
-
asciicompat
_ encoding (22) - assoc (11)
-
base
_ label (11) -
bind
_ call (10) -
block
_ given? (11) - broadcast (9)
- bsearch (22)
-
bsearch
_ index (9) - ceildiv (2)
-
change
_ privilege (22) - chardev? (33)
- children (6)
-
class
_ eval (11) -
class
_ exec (11) -
class
_ variable _ defined? (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) -
class
_ variables (11) - clear (11)
- clone (11)
- compile (11)
-
compile
_ file (11) -
compile
_ option (11) -
compile
_ option= (11) - convert (11)
- cover? (17)
- delete (44)
-
delete
_ if (11) -
destination
_ encoding (11) -
destination
_ encoding _ name (11) - dev (11)
-
dev
_ major (11) -
dev
_ minor (11) - dirname (3)
- disassemble (22)
- div (6)
- divmod (11)
- each (11)
-
each
_ cons (22) -
each
_ pair (33) -
each
_ value (22) - enabled? (6)
- enq (9)
-
error
_ bytes (11) - eval (44)
-
eval
_ script (6) - even? (11)
- event (11)
- exclusive (11)
- exec (22)
-
exit
_ value (11) - fdiv (39)
- fetch (11)
- fill (66)
- filter (36)
- filter! (36)
-
find
_ index (33) -
first
_ column (6) -
first
_ lineno (17) - flatten (22)
- flatten! (11)
-
global
_ variables (11) -
grant
_ privilege (22) - grep (31)
-
grep
_ v (31) - include? (22)
-
incomplete
_ input? (11) - index (29)
- inject (33)
- insert (11)
-
insert
_ output (11) -
instance
_ eval (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variable _ set (11) -
instance
_ variables (11) - iterator? (11)
-
keep
_ if (35) - key (11)
- label (11)
-
last
_ column (6) -
last
_ error (11) -
last
_ lineno (6) - length (22)
- load (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) -
local
_ variable _ defined? (11) -
local
_ variable _ get (11) -
local
_ variable _ set (11) -
local
_ variables (30) - lstrip (11)
- lstrip! (11)
-
max
_ by (44) - member? (22)
- merge (11)
- merge! (22)
-
method
_ removed (11) -
module
_ eval (11) -
module
_ exec (11) - negative? (17)
- new (64)
-
next
_ values (11) - of (2)
- overlap? (1)
- pack (19)
- parse (2)
-
parse
_ file (8) - pause (6)
-
peek
_ values (11) - positive? (17)
-
prev
_ float (10) -
primitive
_ convert (44) - priority= (11)
- private (38)
-
private
_ call? (8) -
private
_ class _ method (15) -
private
_ constant (11) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
private
_ methods (11) - produce (5)
- push (9)
- rassoc (22)
- rdev (11)
-
rdev
_ major (11) -
rdev
_ minor (11) -
readagain
_ bytes (11) - reduce (33)
- rehash (11)
- reject (44)
- reject! (33)
-
remove
_ class _ variable (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) -
remove
_ method (11) - replace (11)
- replacement (11)
- replacement= (11)
-
require
_ relative (11) -
resolve
_ feature _ path (1) -
respond
_ to _ missing? (11) - resume (6)
-
return
_ value (11) - reverse! (22)
-
reverse
_ each (34) - rindex (22)
- rstrip! (11)
-
safe
_ level (7) - select (56)
- select! (56)
- shift (11)
-
sid
_ available? (22) - signal (9)
-
singleton
_ method _ removed (11) - size (22)
-
sort
_ by (22) -
source
_ encoding (11) -
source
_ encoding _ name (11) - spawn (22)
- step (11)
- store (22)
- stress= (11)
- strftime (11)
- strip! (11)
- sum (22)
- system (22)
-
thread
_ variable? (11) -
thread
_ variable _ get (11) -
thread
_ variable _ set (11) - throw (11)
-
to
_ binary (9) -
to
_ h (8) -
trace
_ var (33) -
transform
_ values (16) -
transform
_ values! (16) -
try
_ convert (58) - type (6)
- uniq (22)
- unpack (11)
-
untrace
_ var (11) - update (28)
- upto (11)
-
valid
_ encoding? (11) - value (21)
- values (22)
-
values
_ at (44) -
verify
_ compaction _ references (5) - wait (9)
- warn (7)
- zip (66)
検索結果
先頭5件
- Kernel
. # require _ relative(relative _ feature) -> bool - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol
-
Kernel
. # require _ relative(relative _ feature) -> bool (24902.0) -
現在のファイルからの相対パスで require します。
...相対パスで require します。
require File.expand_path(relative_feature, File.dirname(__FILE__))
とほぼ同じです。
Kernel.#eval などで文字列を評価した場合に、そこから
require_relative を呼出すと必ず失敗します。
@param relative_feature ファイル......名の文字列です。
@raise LoadError ロードに失敗した場合に発生します。
@see Kernel.#require
=== require と load のスコープ
ローカル変数はファイル間では共有されません。ですので、
ロードしたライブラリのローカル変数を
ロード......扱い方はKernel.#loadでも同様です。
//emlist[例][ruby]{
# ---------- some.rb -----------
$a = 1
@a = 1
A = 1
a = 1
# ---------- end some.rb -------
require 'some'
p $a #=> 1
p @a #=> 1
p A #=> 1
p a # undefined local variable or method `a' for #<Object:0x294f9ec @a=1> (NameError)
//}... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (24402.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_by......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (24402.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_by......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (24402.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_by......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (24402.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_by......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (21602.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file......param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
# /tmp/hello.rb
puts "Hello, world!......"
# irb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
Float
# prev _ float -> Float (21402.0) -
浮動小数点数で表現可能な self の前の値を返します。
...現可能な self の前の値を返します。
(-Float::MAX).prev_float と (-Float::INFINITY).prev_float
は -Float::INFINITY を返します。Float::NAN.prev_float は
Float::NAN を返します。
//emlist[例][ruby]{
p 0.01.prev_float # => 0.009999999999999998
p 1.0.prev_float # => 0.999......99999999
p 100.0.prev_float # => 99.99999999999999
p 0.01 - 0.01.prev_float # => 1.734723475976807e-18
p 1.0 - 1.0.prev_float # => 1.1102230246251565e-16
p 100.0 - 100.0.prev_float # => 1.4210854715202004e-14
f = 0.01; 20.times { printf "%-20a %s\n", f, f.to_s; f = f.prev_float }
# => 0x1.47......47ae147ae146dp-7 0.009999999999999976
# 0x1.47ae147ae146cp-7 0.009999999999999974
# 0x1.47ae147ae146bp-7 0.009999999999999972
# 0x1.47ae147ae146ap-7 0.00999999999999997
# 0x1.47ae147ae1469p-7 0.009999999999999969
# 0x1.47ae147ae1468p-7 0.009999999999999967
//}
@see Float#next_float... -
Module
# class _ variable _ set(name , val) -> object (21402.0) -
クラス/モジュールにクラス変数 name を定義して、その値として val をセットします。val を返します。
...値として
val をセットします。val を返します。
@param name String または Symbol を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
def foo
@@foo
end
end
def Fred.foo(val)
class_variable_set(:@@foo, val)
end
p Fred.foo(101) # => 101
p Fred.new.foo... -
Module
# class _ variables(inherit = true) -> [Symbol] (21402.0) -
クラス/モジュールに定義されているクラス変数の名前の配列を返します。
...aram inherit false を指定しない場合はスーパークラスやインクルードして
いるモジュールのクラス変数を含みます。
//emlist[例][ruby]{
class One
@@var1 = 1
end
class Two < One
@@var2 = 2
end
One.class_variables # => [:@@var1]
Two.class_vari......ables # => [:@@var2, :@@var1]
Two.class_variables(false) # => [:@@var2]
//}
@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#constants... -
RubyVM
. resolve _ feature _ path (21402.0) -
require を呼んだときに読み込まれるファイルを特定します。 このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。
...require を呼んだときに読み込まれるファイルを特定します。
このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。
//emlist[][ruby]{
p RubyVM.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.6.0/lib/ruby/2.6.0/set.rb"]
//}... -
Thread
# thread _ variable _ set(key , value) (21402.0) -
引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま す。
... value をセットしま
す。
[注意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、セットした変数は Fiber を切り替えても共通で使える事に注意してく
ださい。
//emlist[例][ruby]{
thr = Thread.new do
Thread.current.thr......ead_variable_set(:cat, 'meow')
Thread.current.thread_variable_set("dog", 'woof')
end
thr.join # => #<Thread:0x401b3f10 dead>
thr.thread_variables # => [:dog, :cat]
//}
@see Thread#thread_variable_get, Thread#[]...