別のキーワード
種類
- インスタンスメソッド (1551)
- 特異メソッド (268)
- モジュール関数 (242)
- クラス (33)
- オブジェクト (11)
クラス
-
ARGF
. class (267) - Array (33)
- BasicObject (44)
- Class (33)
- Data (4)
- Dir (66)
-
Enumerator
:: Lazy (5) - Exception (11)
- FalseClass (55)
- File (44)
- Hash (72)
- IO (44)
- Method (77)
- Module (465)
- NameError (9)
- NilClass (28)
- Object (308)
- Proc (23)
- Regexp (11)
- Struct (44)
- Thread (22)
-
Thread
:: Backtrace :: Location (22) - TracePoint (44)
- TrueClass (44)
- UnboundMethod (22)
モジュール
- Enumerable (22)
- Kernel (132)
- Marshal (22)
- ObjectSpace (88)
キーワード
- != (11)
- & (22)
- < (11)
- << (12)
- <=> (11)
- == (11)
- =~ (6)
- >> (12)
- ARGF (11)
- Method (11)
- Numeric (11)
- String (11)
- UnboundMethod (11)
- [] (22)
- ^ (22)
-
_ dump (11) -
absolute
_ path (11) -
add
_ trace _ func (11) - ancestors (11)
-
append
_ features (11) - arity (22)
- autoload (22)
- autoload? (11)
- bind (11)
-
callee
_ id (11) -
class
_ eval (22) -
class
_ exec (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) - clone (22)
- codepoints (14)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ source _ location (5) - constants (22)
-
count
_ objects (11) - define (4)
-
define
_ finalizer (22) -
define
_ method (22) -
defined
_ class (11) - display (11)
- dump (22)
- dup (22)
-
each
_ char (22) -
each
_ codepoint (22) -
each
_ object (44) - eager (5)
- extend (11)
- fail (33)
-
fixed
_ encoding? (11) -
for
_ fd (11) - gets (24)
-
global
_ variables (11) - include (11)
- include? (11)
- included (11)
- initialize (11)
-
initialize
_ copy (11) -
inplace
_ mode (11) -
inplace
_ mode= (11) - inspect (77)
-
instance
_ eval (22) -
instance
_ methods (11) -
instance
_ of? (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variables (11) -
is
_ a? (11) -
kind
_ of? (11) - lambda? (11)
-
local
_ variables (11) -
marshal
_ dump (11) - merge (22)
-
method
_ id (11) -
method
_ missing (11) - methods (11)
-
module
_ eval (22) -
module
_ exec (11) - name (11)
- nesting (11)
- new (110)
- open (88)
- parameters (11)
- path (22)
- pos (11)
- pos= (11)
- prepend (11)
-
prepend
_ features (11) - prepended (11)
- print (11)
- printf (11)
- private (23)
-
private
_ class _ method (15) -
private
_ constant (11) -
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ class _ method (15) -
public
_ constant (11) -
public
_ method (11) -
public
_ method _ defined? (11) - putc (11)
- puts (11)
- raise (33)
- rationalize (11)
-
read
_ nonblock (9) - readpartial (11)
- receiver (9)
-
remove
_ class _ variable (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) - replace (11)
-
respond
_ to? (11) -
respond
_ to _ missing? (11) - send (22)
-
set
_ encoding (22) -
set
_ trace _ func (22) -
singleton
_ methods (11) - skip (11)
-
sort
_ by (22) -
super
_ method (10) - superclass (11)
- tell (11)
-
to
_ ary (11) -
to
_ c (11) -
to
_ h (17) -
to
_ hash (11) -
to
_ int (11) -
to
_ proc (22) -
to
_ regexp (11) -
to
_ s (44) -
to
_ str (11) -
undefine
_ finalizer (11) - | (22)
検索結果
先頭5件
-
Class
# superclass -> Class | nil (21321.0) -
自身のスーパークラスを返します。
...]{
File.superclass #=> IO
IO.superclass #=> Object
class Foo; end
class Bar < Foo; end
Bar.superclass #=> Foo
Object.superclass #=> BasicObject
//}
ただし BasicObject.superclass は nil を返します。
//emlist[例][ruby]{
BasicObject.superclass #=> nil......//}
@see Class#subclasses... -
Object
# class -> Class (18294.0) -
レシーバのクラスを返します。
...レシーバのクラスを返します。
//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}
@see Class#superclass,Object#kind_of?,Object#instance_of?... -
Module
# public _ class _ method(*name) -> self (12228.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...の
可視性を public に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end......Foo.foo # NoMethodError: private method `foo' called for Foo:Class
Foo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Module
# public _ class _ method(names) -> self (12228.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...の
可視性を public に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end......Foo.foo # NoMethodError: private method `foo' called for Foo:Class
Foo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Module
# public _ class _ method(*name) -> self (12227.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...性を public に変更します。
@param name 0 個以上の String または Symbol を指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end
Foo.foo # NoMethodError: private method `foo' called for Foo:Class
Foo.public_class_method(... -
Module
# private _ class _ method(*name) -> self (12222.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...の
可視性を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_d......efined?(:foo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
Module
# private _ class _ method(names) -> self (12222.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...の
可視性を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_d......efined?(:foo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
Module
# private _ class _ method(*name) -> self (12221.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...性を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:foo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_m... -
Class
. new(superclass = Object) -> Class (9370.0) -
新しく名前の付いていない superclass のサブクラスを生成します。
...ない superclass のサブクラスを生成します。
名前のないクラスは、最初に名前を求める際に代入されている定数名を検
索し、見つかった定数名をクラス名とします。
//emlist[例][ruby]{
p foo = Class.new # => #<Class:0x401b90f8>
p foo.name......# => nil
Foo = foo # ここで p foo すれば "Foo" 固定
Bar = foo
p foo.name # => "Bar" ("Foo" になるか "Bar" になるかは不定)
//}
ブロックが与えられた場合、生成したクラスを引数として
クラスのコンテキストでブロック...... Class.new(superclass)
klass.module_eval {|m|
# ...
}
klass
//}
この場合も生成したクラスを返します。
ブロックの実行は Class#initialize が行います。
@param superclass 生成するクラスのスーパークラスを指定します。
//emlist[例][ruby]{
k = Class... -
Class
. new(superclass = Object) {|klass| . . . } -> Class (9370.0) -
新しく名前の付いていない superclass のサブクラスを生成します。
...ない superclass のサブクラスを生成します。
名前のないクラスは、最初に名前を求める際に代入されている定数名を検
索し、見つかった定数名をクラス名とします。
//emlist[例][ruby]{
p foo = Class.new # => #<Class:0x401b90f8>
p foo.name......# => nil
Foo = foo # ここで p foo すれば "Foo" 固定
Bar = foo
p foo.name # => "Bar" ("Foo" になるか "Bar" になるかは不定)
//}
ブロックが与えられた場合、生成したクラスを引数として
クラスのコンテキストでブロック...... Class.new(superclass)
klass.module_eval {|m|
# ...
}
klass
//}
この場合も生成したクラスを返します。
ブロックの実行は Class#initialize が行います。
@param superclass 生成するクラスのスーパークラスを指定します。
//emlist[例][ruby]{
k = Class... -
TracePoint
# defined _ class -> Class | module (9270.0) -
メソッドを定義したクラスかモジュールを返します。
...メソッドを定義したクラスかモジュールを返します。
//emlist[例][ruby]{
class C; 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 は特異クラ
スを返します。また、K......はなく元のクラスを返します。
//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 の上記の差分に注意して
ください。
@see 508... -
ARGF
. class # readpartial(maxlen , outbuf = nil) -> String (9124.0) -
IO#readpartialを参照。ARGF.class#read などとは違って複数ファ イルを同時に読み込むことはありません。
...IO#readpartialを参照。ARGF.class#read などとは違って複数ファ
イルを同時に読み込むことはありません。
@param maxlen 読み込む長さの上限を整数で指定します。
@param outbuf 読み込んだデータを格納する String オブジェクトを指定し......ます。
@see IO#readpartial, ARGF.class#read_nonblock... -
ARGF
. class # codepoints -> Enumerator (9118.0) -
このメソッドは obsolete です。 代わりに ARGF.class#each_codepoint を使用してください。 使用すると警告メッセージが表示されます。
...このメソッドは obsolete です。
代わりに ARGF.class#each_codepoint を使用してください。
使用すると警告メッセージが表示されます。...