クラス
-
ARGF
. class (121) - Array (223)
- BasicObject (132)
- Binding (54)
- Class (36)
- Data (4)
- Dir (66)
-
Encoding
:: Converter (44) -
Encoding
:: InvalidByteSequenceError (22) -
Encoding
:: UndefinedConversionError (11) - Enumerator (110)
-
Enumerator
:: ArithmeticSequence (30) -
Enumerator
:: Lazy (44) -
Enumerator
:: Yielder (27) - Exception (117)
- Fiber (29)
- File (33)
-
File
:: Stat (66) - FrozenError (5)
- Hash (72)
- IO (294)
- Integer (21)
- KeyError (14)
- LoadError (11)
- LocalJumpError (22)
- MatchData (92)
- Method (203)
- Module (811)
- Mutex (8)
- NameError (40)
- NoMethodError (11)
- Numeric (95)
- Object (418)
- Proc (83)
- Random (33)
- Range (134)
- Refinement (3)
- Regexp (66)
-
RubyVM
:: InstructionSequence (55) - SignalException (22)
- StopIteration (11)
- String (176)
- Symbol (10)
- SystemCallError (11)
- SystemExit (22)
- Thread (132)
-
Thread
:: Backtrace :: Location (44) -
Thread
:: ConditionVariable (18) -
Thread
:: Mutex (36) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (27) - TracePoint (172)
- UnboundMethod (33)
- UncaughtThrowError (30)
モジュール
- Comparable (10)
- Enumerable (223)
キーワード
- ! (11)
- != (11)
- % (11)
-
/ (10) - < (11)
- << (23)
- <= (11)
- <=> (11)
- == (50)
- === (68)
- =~ (11)
- > (11)
- >= (11)
- >> (12)
- [] (110)
- []= (33)
-
_ _ send _ _ (22) -
_ dump (11) -
absolute
_ path (22) -
add
_ trace _ func (11) -
alias
_ method (11) - allocate (11)
- ancestors (11)
- append (7)
-
append
_ features (11) - args (11)
- arity (22)
- at (11)
- attr (33)
-
attr
_ accessor (11) -
attr
_ reader (11) -
attr
_ writer (11) - autoclose? (11)
- autoload (11)
- backtrace (22)
-
backtrace
_ locations (11) -
base
_ label (22) - begin (28)
- bind (11)
- binding (22)
- binmode (11)
- blockdev? (11)
- broadcast (9)
- byteoffset (4)
- call (33)
-
callee
_ id (11) - cause (11)
- chardev? (11)
- chunk (11)
- clamp (10)
-
class
_ eval (22) -
class
_ exec (11) -
class
_ variable _ defined? (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) -
class
_ variables (11) - clone (33)
- close (9)
-
close
_ read (11) -
close
_ write (11) - coerce (11)
- compact (3)
-
const
_ added (2) -
const
_ defined? (11) -
const
_ get (11) -
const
_ missing (11) -
const
_ set (11) -
const
_ source _ location (5) - constants (11)
- cover? (17)
- crypt (11)
- curry (20)
- deconstruct (2)
-
deconstruct
_ keys (2) -
default
_ proc= (11) -
define
_ method (22) -
define
_ singleton _ method (22) -
defined
_ class (11) -
delete
_ suffix (7) -
delete
_ suffix! (7) - deq (18)
- disable (22)
- display (11)
- div (11)
- dup (22)
- each (110)
-
each
_ byte (44) -
each
_ codepoint (22) -
each
_ entry (22) -
each
_ index (22) -
each
_ line (66) -
each
_ with _ index (22) - enable (22)
-
end
_ with? (16) -
enum
_ for (44) - eql? (11)
- errno (11)
-
error
_ bytes (11) -
error
_ char (11) - eval (11)
-
eval
_ script (6) - event (11)
- exception (22)
-
exclude
_ end? (17) - exit (11)
-
exit
_ value (11) - extend (11)
-
extend
_ object (11) - extended (11)
- fcntl (11)
- fdatasync (11)
- feed (11)
- fetch (33)
- first (22)
-
first
_ lineno (11) -
fixed
_ encoding? (11) - flush (11)
- freeze (11)
- hash (17)
-
import
_ methods (3) - include (11)
- include? (11)
- included (11)
-
included
_ modules (11) -
incomplete
_ input? (11) - inherited (11)
- initialize (11)
-
initialize
_ copy (11) -
inplace
_ mode= (11) - inspect (66)
-
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ methods (11) -
instance
_ of? (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instruction
_ sequence (6) -
internal
_ encoding (11) - invert (11)
-
is
_ a? (11) - key (7)
- kill (11)
-
kind
_ of? (11) - label (11)
- lambda? (11)
- last (22)
- lazy (11)
- lineno (11)
-
local
_ variable _ defined? (11) -
local
_ variable _ get (11) -
local
_ variable _ set (11) -
local
_ variables (19) - lstat (11)
-
marshal
_ dump (11) - match (22)
- max (44)
-
max
_ by (44) - merge (22)
-
method
_ added (11) -
method
_ defined? (11) -
method
_ id (11) -
method
_ missing (11) -
method
_ removed (11) -
method
_ undefined (11) - methods (11)
- min (44)
-
module
_ eval (22) -
module
_ exec (11) -
module
_ function (19) - name (33)
- next (11)
-
next
_ values (11) - offset (22)
-
original
_ name (22) - overlap? (1)
- owned? (11)
- owner (11)
- pack (19)
- parameters (6)
- path (44)
-
peek
_ values (11) -
pending
_ interrupt? (11) - pid (11)
- pop (18)
- pos (11)
- pos= (22)
- pread (7)
- prepend (37)
-
prepend
_ features (11) - prepended (11)
-
primitive
_ convert (44) - priority (11)
- priority= (11)
- private (23)
-
private
_ class _ method (15) -
private
_ constant (11) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) - public (23)
-
public
_ class _ method (15) -
public
_ constant (11) -
public
_ method _ defined? (11) -
public
_ send (22) - push (7)
- pwrite (7)
- raise (26)
-
raised
_ exception (11) - rand (33)
- read (11)
- readbyte (22)
- readchar (11)
- reason (11)
- receiver (32)
- refine (11)
-
remove
_ class _ variable (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) -
remove
_ method (11) - replace (11)
-
respond
_ to? (11) -
respond
_ to _ missing? (11) - result (11)
- resume (11)
-
return
_ value (11) - rewind (11)
-
ruby2
_ keywords (10) - seek (22)
- send (22)
-
set
_ backtrace (11) -
set
_ encoding _ by _ bom (5) -
set
_ trace _ func (11) - setgid? (11)
- setuid? (11)
- shift (18)
- signal (9)
- signm (11)
- signo (11)
-
singleton
_ class? (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - size (11)
- sleep (11)
- socket? (11)
-
sort
_ by (22) -
source
_ location (11) -
start
_ with? (16) - stat (11)
- status (11)
- step (84)
- sticky? (11)
- subclasses (3)
- success? (11)
- sum (11)
-
super
_ method (10) - superclass (11)
- sync (11)
- synchronize (11)
- sysseek (11)
- syswrite (11)
- tag (10)
- tell (11)
- terminate (11)
-
thread
_ variable _ set (11) -
to
_ a (11) -
to
_ ary (22) -
to
_ enum (44) -
to
_ h (17) -
to
_ hash (11) -
to
_ int (11) -
to
_ path (11) -
to
_ proc (27) -
to
_ regexp (11) -
to
_ s (76) -
to
_ str (11) - transfer (3)
- truncate (11)
- unbind (11)
-
undef
_ method (11) - unlock (11)
- unpack (11)
- unshift (7)
- upto (11)
- value (10)
-
with
_ object (22) - write (11)
- yield (22)
- ~ (11)
検索結果
先頭5件
-
Object
# public _ send(name , *args) -> object (6103.0) -
オブジェクトの public メソッド name を args を引数にして呼び出し、メソッ ドの実行結果を返します。
...行結果を返します。
ブロック付きで呼ばれたときはブロックもそのまま引き渡します。
//emlist[][ruby]{
1.public_send(:+, 2) # => 3
//}
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数で......しなかった場合に発生します。
@raise NoMethodError protected メソッドや private メソッドに対して実行
した場合に発生します。
//emlist[][ruby]{
1.public_send(:puts, "hello") # => NoMethodError
//}
@see BasicObject#__send__, Object#send... -
Object
# public _ send(name , *args) { . . . . } -> object (6103.0) -
オブジェクトの public メソッド name を args を引数にして呼び出し、メソッ ドの実行結果を返します。
...行結果を返します。
ブロック付きで呼ばれたときはブロックもそのまま引き渡します。
//emlist[][ruby]{
1.public_send(:+, 2) # => 3
//}
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数で......しなかった場合に発生します。
@raise NoMethodError protected メソッドや private メソッドに対して実行
した場合に発生します。
//emlist[][ruby]{
1.public_send(:puts, "hello") # => NoMethodError
//}
@see BasicObject#__send__, Object#send... -
String
# prepend(*arguments) -> String (6103.0) -
複数の文字列を先頭に破壊的に追加します。
...列を先頭に破壊的に追加します。
@param arguments 追加したい文字列を指定します。
//emlist[例][ruby]{
a = "!!!"
a.prepend # => "!!!"
a # => "!!!"
a = "!!!"
a.prepend "hello ", "world" # => "hello world!!!"
a # => "hello world!!!"
//}... -
String
# prepend(other _ str) -> String (6103.0) -
文字列 other_str を先頭に破壊的に追加します。
...文字列 other_str を先頭に破壊的に追加します。
@param other_str 追加したい文字列を指定します。
//emlist[例][ruby]{
a = "world"
a.prepend("hello ") # => "hello world"
a # => "hello world"
//}... -
Thread
# pending _ interrupt?(error = nil) -> bool (6103.0) -
self の非同期例外のキューが空かどうかを返します。
...self の非同期例外のキューが空かどうかを返します。
@param error 対象の例外クラスを指定します。
@see Thread.pending_interrupt?... -
Range
# last(n) -> [object] (3010.0) -
最後の n 要素を返します。範囲内に要素が含まれない場合は空の配列を返します。
...の数を指定した場合に発生します。
[注意] 引数を省略して実行した場合は、終端を含むかどうか
(Range#exclude_end? の戻り値)に関わらず終端の要素を返す事に注意し
てください。
//emlist[例][ruby]{
(10..20).last(3) # => [18, 19, 20]
(1... -
Range
# last -> object (3005.0) -
終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま せん。
終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま
せん。
//emlist[例][ruby]{
(10..20).last # => 20
(10...20).last # => 20
//}
@see Range#begin -
Array
# push(*obj) -> self (3003.0) -
指定された obj を順番に配列の末尾に追加します。 引数を指定しなければ何もしません。
指定された obj を順番に配列の末尾に追加します。
引数を指定しなければ何もしません。
@param obj 自身に追加したいオブジェクトを指定します。
//emlist[例][ruby]{
array = [1, 2, 3]
array.push 4
array.push [5, 6]
array.push 7, 8
p array # => [1, 2, 3, 4, [5, 6], 7, 8]
//}
@see Array#pop, Array#shift, Array#unshift, Array#<< -
Array
# unshift(*obj) -> self (3003.0) -
指定された obj を引数の最後から順番に配列の先頭に挿入します。 引数を指定しなければ何もしません。
指定された obj を引数の最後から順番に配列の先頭に挿入します。
引数を指定しなければ何もしません。
@param obj 自身に追加したいオブジェクトを指定します。
//emlist[例][ruby]{
arr = [1,2,3]
arr.unshift 0
p arr #=> [0, 1, 2, 3]
arr.unshift [0]
p arr #=> [[0], 0, 1, 2, 3]
arr.unshift 1, 2
p arr #=> [1, 2, [0], 0, 1, 2, 3]
//}
@see A... -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (99.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
...を返します。
inherited_too が真のときは継承した特異メソッドを含みます。
継承した特異メソッドとは Object#extend によって追加された特異メソッドや、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタ......vate_class_parent() end
protected; def protected_class_parent() end
public; def public_class_parent() end
end
Foo = Class.new(Parent)
class <<Foo
private; def private_class_foo() end
protected; def protected_class_foo() end
public; def public_class_foo() end
end
module Bar
pri......vate; def private_bar() end
protected; def protected_bar() end
public; def public_bar() end
end
obj = Foo.new
class <<obj
include Bar
private; def private_self() end
protected; def protected_self() end
public; def public_self() end
end
# あるオブジェクトの... -
Module
# autoload(const _ name , feature) -> nil (81.0) -
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
...d する対象を指定する。
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
autoload :Bar, '/tmp/foo'
end
p Foo::Bar #=> Foo::Bar
//}
以下のようにモジュールを明示的にレシーバとして呼び......出すこともできます。
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
end
Foo.autoload :Bar, '/tmp/foo'
p Foo::Bar #=> Foo::Bar
//}
以下のように、autoload したライブラリがネストした定数......(警告メッ
セージが出ています)。
//emlist[例][ruby]{
# ------- /tmp/bar.rb ---------
class Bar
end
# ----- end of /tmp/bar.rb ----
class Foo
autoload :Bar, '/tmp/bar.rb'
end
p Foo::Bar
p Foo.autoload?(:Bar)
#=> -:4: warning: toplevel constant Bar referenced by Foo::Bar
# Bar
#... -
TracePoint
# defined _ class -> Class | module (81.0) -
メソッドを定義したクラスかモジュールを返します。
...def foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => C
end.enable do
C.new.foo
end
//}
メソッドがモジュールで定義されていた場合も(include に関係なく)モジュー
ルを返します。
//emlist[例][ruby]{
module M; def foo; end; end
class C......; include M; end;
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => M
end.enable do
C.new.foo
end
//}
[注意] 特異メソッドを実行した場合は TracePoint#defined_class は特異クラ
スを返します。また、Kernel.#set_trace_func の 6 番目のブロックパ
ラ......スではなく元のクラスを返します。
//emlist[例][ruby]{
class C; def self.foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => #<Class:C>
end.enable do
C.foo
end
//}
Kernel.#set_trace_func と TracePoint の上記の差分に注意して
ください。
@s...