クラス
-
ARGF
. class (192) - Array (806)
- BasicObject (168)
- Binding (44)
- Class (72)
- Complex (12)
- Data (12)
- Dir (120)
- Enumerator (156)
-
Enumerator
:: Chain (21) -
Enumerator
:: Lazy (60) -
Enumerator
:: Yielder (24) - Fiber (46)
- File (36)
- FrozenError (6)
- Hash (301)
- IO (360)
- Integer (4)
- KeyError (16)
- LocalJumpError (12)
- MatchData (12)
- Method (92)
- Module (498)
- Mutex (2)
- NameError (34)
- NoMethodError (12)
- Numeric (12)
- Object (1111)
-
ObjectSpace
:: WeakMap (12) - Proc (31)
- Random (36)
- Range (200)
- Rational (12)
- Regexp (36)
-
RubyVM
:: InstructionSequence (12) - Set (9)
- StopIteration (12)
- String (93)
- Struct (114)
- Symbol (4)
- Thread (80)
-
Thread
:: Mutex (10) -
Thread
:: Queue (30) -
Thread
:: SizedQueue (30) - Time (12)
- TracePoint (90)
- UnboundMethod (24)
- UncaughtThrowError (22)
モジュール
- Comparable (15)
- Enumerable (780)
- GC (26)
-
GC
:: Profiler (24) - Kernel (458)
- Marshal (72)
- ObjectSpace (120)
-
Process
:: GID (24) -
Process
:: UID (24)
キーワード
- ! (12)
- != (12)
- !~ (12)
-
$ * (12) -
$ -K (5) -
$ -i (12) -
$ . (12) -
$ < (12) -
$ > (12) -
$ FILENAME (12) -
$ KCODE (5) -
$ SAFE (5) -
$ _ (12) -
$ stderr (12) -
$ stdin (12) -
$ stdout (12) - % (12)
- & (12)
- - (12)
- < (12)
- << (24)
- <= (12)
- <=> (24)
- == (54)
- === (56)
- =~ (9)
- >= (12)
- ARGF (12)
- ARGV (12)
- Array (12)
- DATA (12)
- ENV (12)
- FALSE (8)
- Float (12)
- Integer (12)
-
MAJOR
_ VERSION (12) -
MINOR
_ VERSION (12) - Method (12)
- NIL (8)
- NoMethodError (12)
-
RUBY
_ COPYRIGHT (12) -
RUBY
_ DESCRIPTION (12) -
RUBY
_ ENGINE (12) -
RUBY
_ ENGINE _ VERSION (10) -
RUBY
_ PATCHLEVEL (12) -
RUBY
_ PLATFORM (12) -
RUBY
_ RELEASE _ DATE (12) -
RUBY
_ REVISION (12) -
RUBY
_ VERSION (12) - Rational (12)
-
SCRIPT
_ LINES _ _ (12) - STDERR (12)
- STDIN (12)
- STDOUT (12)
- String (12)
-
TOPLEVEL
_ BINDING (12) - TRUE (8)
- Thread (12)
- [] (96)
-
_ _ id _ _ (12) -
_ _ send _ _ (24) -
_ dump (12) -
_ id2ref (12) -
_ load (12) - allocate (12)
- ancestors (12)
- args (12)
- argv (12)
- at (12)
- begin (12)
-
bind
_ call (12) - binding (12)
- bsearch (48)
- call (24)
- catch (24)
- chdir (48)
- clamp (27)
- class (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - clone (39)
- collect (48)
-
compare
_ by _ identity (12) -
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (24)
-
count
_ objects (12) - cycle (24)
- deconstruct (9)
- default (24)
-
define
_ finalizer (24) -
define
_ method (24) -
define
_ singleton _ method (24) - delete (48)
-
delete
_ at (12) -
deprecate
_ constant (12) - deq (20)
- detect (24)
- difference (7)
- dig (30)
- disable (24)
- display (12)
- dump (24)
- dup (31)
- each (110)
-
each
_ byte (24) -
each
_ char (24) -
each
_ line (48) -
each
_ object (48) -
each
_ with _ object (24) - enable (24)
- end (12)
- entries (12)
-
enum
_ for (48) - eql? (51)
- equal? (36)
- eval (48)
- exclusive (12)
-
exit
_ value (12) - extend (12)
-
extend
_ object (12) - extended (12)
- feed (12)
- fetch (80)
-
fetch
_ values (20) - fill (72)
- filter (42)
-
filter
_ map (12) - find (24)
-
find
_ all (24) - first (72)
-
for
_ fd (12) - force (12)
- format (12)
- freeze (24)
- frozen? (12)
-
garbage
_ collect (12) - getbyte (12)
- getc (12)
- gets (12)
-
global
_ variables (12) - grep (24)
-
grep
_ v (24) -
handle
_ interrupt (12) - hash (39)
- include (24)
- index (7)
- initialize (12)
-
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) - inject (36)
- inspect (24)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) - intersection (6)
- irb (9)
-
is
_ a? (12) - itself (12)
- key (20)
- keys (12)
-
kind
_ of? (12) - lambda (13)
- last (48)
-
latest
_ gc _ info (24) - load (12)
-
local
_ variable _ get (12) -
local
_ variables (12) - loop (24)
- map (48)
-
marshal
_ dump (12) -
marshal
_ load (12) - match (48)
- max (130)
-
max
_ by (48) - method (12)
-
method
_ missing (12) - methods (12)
- min (130)
-
min
_ by (48) - minmax (48)
-
minmax
_ by (24) -
module
_ eval (24) -
module
_ exec (12) - name (12)
- new (139)
- next (12)
-
next
_ values (12) - nil? (12)
-
object
_ id (12) - open (120)
- p (12)
- parameters (43)
- partition (24)
- peek (12)
-
peek
_ values (12) -
pending
_ interrupt? (12) - pipe (96)
- pop (44)
- popen (168)
- pp (8)
-
private
_ constant (9) -
private
_ instance _ methods (12) -
private
_ methods (12) - proc (14)
-
protected
_ instance _ methods (12) -
protected
_ methods (12) - public (48)
-
public
_ constant (9) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
public
_ method (12) -
public
_ methods (12) -
public
_ send (24) - putc (36)
- raise (18)
- rand (36)
-
read
_ nonblock (12) - readline (12)
- receiver (47)
- reduce (36)
- rehash (12)
- reject (48)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) - replace (12)
- report (12)
-
require
_ relative (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - restore (12)
- result (24)
- resume (12)
-
return
_ value (12) - rewind (7)
- sample (48)
- select (72)
- self (12)
- send (24)
- shift (56)
-
singleton
_ class (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) - slice (36)
- slice! (36)
- sort (24)
-
sort
_ by (24) - sprintf (12)
- stat (13)
- store (12)
- string (12)
- sum (42)
- superclass (12)
- switch (48)
- synchronize (12)
- tag (11)
- taint (9)
- tainted? (9)
- tally (10)
- tap (12)
- then (14)
-
thread
_ variable _ get (12) - throw (12)
-
to
_ a (36) -
to
_ ary (12) -
to
_ enum (48) -
to
_ hash (24) -
to
_ int (12) -
to
_ io (12) -
to
_ proc (16) -
to
_ regexp (12) -
to
_ s (36) -
to
_ str (12) - transfer (4)
- trust (9)
-
try
_ convert (16) -
undefine
_ finalizer (12) - union (7)
- uniq (24)
- uniq! (24)
- unpack1 (9)
- untaint (9)
- untrust (9)
- untrusted? (9)
-
used
_ modules (12) - value (23)
- values (24)
-
values
_ at (24) -
with
_ index (24) -
with
_ object (24) -
write
_ nonblock (12) - yield (24)
-
yield
_ self (16) - zip (48)
- | (12)
検索結果
先頭5件
-
Module
# >(other) -> bool | nil (18144.0) -
比較演算子。 self が other の先祖である場合、true を返します。 self が other の子孫か同一クラスである場合、false を返します。
...nded
prepend Awesome
end
Included.ancestors # => [Included, Awesome]
Awesome > Included # => true
Included > Awesome # => false
Prepended.ancestors # => [Awesome, Prepended]
Awesome > Prepended # => true
Prepended > Awesome # => false
Awesome > Awesome # => false
Awesome > Object # => nil
//}... -
Object
# object _ id -> Integer (15281.0) -
各オブジェクトに対して一意な整数を返します。あるオブジェクトに対し てどのような整数が割り当てられるかは不定です。
...られるかは不定です。
Rubyでは、(Garbage Collectされていない)アクティブなオブジェクト間で
重複しない整数(object_id)が各オブジェクトにひとつずつ割り当てられています。この
メソッドはその値を返します。
TrueClass, FalseCla...... object_id になります。
これは、Immutable ならば複数の場所から参照されても`破壊的操作'による問題が発生しないので、
同じ内容のインスタンスを複数生成しないという内部実装が理由です。
//emlist[][ruby]{
p "ruby".object_id #=>......60
p "ruby".object_id #=> 80
p [].object_id #=> 100
p [].object_id #=> 120
p :ruby.object_id #=> 710428
p :ruby.object_id #=> 710428
p 11.object_id #=> 23
p 11.object_id #=> 23
p true.object_id #=> 20
p true.object_id #=> 20
//}
@see Object#equal?,Symbol... -
Object
# <=>(other) -> 0 | nil (15120.0) -
self === other である場合に 0 を返します。そうでない場合には nil を返します。
...self === other である場合に 0 を返します。そうでない場合には nil を返します。
//emlist[例][ruby]{
a = Object.new
b = Object.new
a <=> a # => 0
a <=> b # => nil
//}
@see Object#===... -
ObjectSpace
. # each _ object {|object| . . . } -> Integer (9354.0) -
指定された klass と Object#kind_of? の関係にある全ての オブジェクトに対して繰り返します。引数が省略された時には全てのオブ ジェクトに対して繰り返します。 繰り返した数を返します。
...指定された klass と Object#kind_of? の関係にある全ての
オブジェクトに対して繰り返します。引数が省略された時には全てのオブ
ジェクトに対して繰り返します。
繰り返した数を返します。
ブロックが与えられなかった場合......]{
p ObjectSpace.each_object
# => #<Enumerator: ObjectSpace:each_object(false)>
//}
//emlist[例: 全てのオブジェクトを扱う][ruby]{
ObjectSpace.each_object.take(5).each { |x| p x }
count = ObjectSpace.each_object { |x| x }
puts "Total count: #{count}"
# => "scope"
# => "scopes"
# => "sy......m"
# => "class_names"
# => "@corrections"
# => Total count: 9938
//}
//emlist[例: 任意のクラスを扱う][ruby]{
Person = Struct.new(:name)
s1 = Person.new("tanaka")
s2 = Person.new("sato")
count = ObjectSpace.each_object(Person) { |x| p x }
puts "Total count: #{count}"
# => #<struct Person... -
ObjectSpace
. # each _ object(klass) {|object| . . . } -> Integer (9354.0) -
指定された klass と Object#kind_of? の関係にある全ての オブジェクトに対して繰り返します。引数が省略された時には全てのオブ ジェクトに対して繰り返します。 繰り返した数を返します。
...指定された klass と Object#kind_of? の関係にある全ての
オブジェクトに対して繰り返します。引数が省略された時には全てのオブ
ジェクトに対して繰り返します。
繰り返した数を返します。
ブロックが与えられなかった場合......]{
p ObjectSpace.each_object
# => #<Enumerator: ObjectSpace:each_object(false)>
//}
//emlist[例: 全てのオブジェクトを扱う][ruby]{
ObjectSpace.each_object.take(5).each { |x| p x }
count = ObjectSpace.each_object { |x| x }
puts "Total count: #{count}"
# => "scope"
# => "scopes"
# => "sy......m"
# => "class_names"
# => "@corrections"
# => Total count: 9938
//}
//emlist[例: 任意のクラスを扱う][ruby]{
Person = Struct.new(:name)
s1 = Person.new("tanaka")
s2 = Person.new("sato")
count = ObjectSpace.each_object(Person) { |x| p x }
puts "Total count: #{count}"
# => #<struct Person... -
Object
# initialize _ copy(obj) -> object (9305.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...elf のインスタンス変数や特異メソッドは変化しません。
デフォルトでは、Object#clone の内部で Object#initialize_clone から、
また Object#dup の内部で Object#initialize_dup から呼ばれます。
initialize_copy は、Ruby インタプリタが知り得......alize_copy でコピーするよう定義しておくことで、dup や clone
を再定義する必要がなくなります。
デフォルトの Object#initialize_copy は、 freeze チェックおよび型のチェックを行い self
を返すだけのメソッドです。
initialize_copy と......Error レシーバが freeze されているか、obj のクラスがレシーバ
のクラスと異なる場合に発生します。
@see Object#clone,Object#dup
以下に例として、dup や clone がこのメソッドをどのように利用しているかを示します。
obj.dup は、... -
ObjectSpace
. # each _ object -> Enumerator (9254.0) -
指定された klass と Object#kind_of? の関係にある全ての オブジェクトに対して繰り返します。引数が省略された時には全てのオブ ジェクトに対して繰り返します。 繰り返した数を返します。
...指定された klass と Object#kind_of? の関係にある全ての
オブジェクトに対して繰り返します。引数が省略された時には全てのオブ
ジェクトに対して繰り返します。
繰り返した数を返します。
ブロックが与えられなかった場合......]{
p ObjectSpace.each_object
# => #<Enumerator: ObjectSpace:each_object(false)>
//}
//emlist[例: 全てのオブジェクトを扱う][ruby]{
ObjectSpace.each_object.take(5).each { |x| p x }
count = ObjectSpace.each_object { |x| x }
puts "Total count: #{count}"
# => "scope"
# => "scopes"
# => "sy......m"
# => "class_names"
# => "@corrections"
# => Total count: 9938
//}
//emlist[例: 任意のクラスを扱う][ruby]{
Person = Struct.new(:name)
s1 = Person.new("tanaka")
s2 = Person.new("sato")
count = ObjectSpace.each_object(Person) { |x| p x }
puts "Total count: #{count}"
# => #<struct Person... -
ObjectSpace
. # each _ object(klass) -> Enumerator (9254.0) -
指定された klass と Object#kind_of? の関係にある全ての オブジェクトに対して繰り返します。引数が省略された時には全てのオブ ジェクトに対して繰り返します。 繰り返した数を返します。
...指定された klass と Object#kind_of? の関係にある全ての
オブジェクトに対して繰り返します。引数が省略された時には全てのオブ
ジェクトに対して繰り返します。
繰り返した数を返します。
ブロックが与えられなかった場合......]{
p ObjectSpace.each_object
# => #<Enumerator: ObjectSpace:each_object(false)>
//}
//emlist[例: 全てのオブジェクトを扱う][ruby]{
ObjectSpace.each_object.take(5).each { |x| p x }
count = ObjectSpace.each_object { |x| x }
puts "Total count: #{count}"
# => "scope"
# => "scopes"
# => "sy......m"
# => "class_names"
# => "@corrections"
# => Total count: 9938
//}
//emlist[例: 任意のクラスを扱う][ruby]{
Person = Struct.new(:name)
s1 = Person.new("tanaka")
s2 = Person.new("sato")
count = ObjectSpace.each_object(Person) { |x| p x }
puts "Total count: #{count}"
# => #<struct Person... -
Object
# initialize _ clone(obj) -> object (9237.0) -
Object#clone がオブジェクトを複製する際に呼び出すメソッドです。
...
Object#clone がオブジェクトを複製する際に呼び出すメソッドです。
デフォルトでは Object#initialize_copy を呼び出します。
initialize_clone という名前のメソッドは自動的に private に設定されます。
@see Object#initialize_copy, Object#initi...