1901件ヒット
[1-100件を表示]
(0.051秒)
別のキーワード
ライブラリ
クラス
-
ARGF
. class (348) - Array (24)
- BasicObject (72)
- Class (12)
-
Enumerator
:: Lazy (12) - Hash (79)
- Integer (12)
- Method (117)
- Module (312)
- NameError (10)
- Object (120)
- OptionParser (144)
- Proc (14)
- Range (12)
-
RubyVM
:: InstructionSequence (12) -
Thread
:: Backtrace :: Location (36) - TracePoint (12)
-
URI
:: Generic (24) - UnboundMethod (12)
-
WIN32OLE
_ TYPE (24)
モジュール
-
ERB
:: DefMethod (12) - Enumerable (48)
- JSON (12)
- ObjectSpace (36)
キーワード
- ! (12)
- != (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- << (14)
- <=> (12)
- == (12)
- === (8)
- >> (14)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 1 . 0 (4) - Numeric (12)
- Observable (12)
- Options (12)
- ReFe (12)
- Ruby プログラムの実行 (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Ruby用語集 (12)
- SingleForwardable (12)
- UnboundMethod (12)
- [] (12)
-
_ dump (12) -
absolute
_ path (12) -
append
_ features (12) - autoload (12)
-
base
_ label (12) - bind (12)
- binmode (12)
- bytes (14)
- call (24)
- chars (14)
-
class
_ eval (24) -
class
_ exec (12) - clone (12)
- close (12)
- codepoints (14)
- component (12)
-
create
_ id (12) -
def
_ erb _ method (12) -
default
_ event _ sources (12) -
default
_ port (12) -
define
_ finalizer (24) -
define
_ singleton _ method (24) -
defined
_ class (12) - display (12)
-
drb
/ gw (12) - dup (12)
- each (48)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ entry (24) -
each
_ line (48) - extend (12)
- getbyte (12)
- getc (12)
- include (12)
- include? (12)
- included (12)
- inherited (12)
-
initialize
_ copy (12) - inspect (12)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) - irb (12)
- lines (42)
-
marshal
_ load (12) - merge (24)
-
module
_ eval (24) -
module
_ exec (12) - new (24)
-
ole
_ type (12) - on (144)
- pp (12)
- prepend (12)
-
prepend
_ features (12) - prepended (12)
-
pretty
_ print (12) -
private
_ class _ method (24) -
private
_ constant (12) -
public
_ class _ method (24) -
public
_ constant (12) -
rdoc
/ generator (12) -
rdoc
/ generator / json _ index (12) - receiver (10)
-
remove
_ method (12) - replace (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
set
_ encoding (36) -
singleton
_ class? (12) -
singleton
_ methods (12) - skip (12)
-
sort
_ by (24) -
super
_ method (11) - superclass (12)
-
to
_ a (24) -
to
_ ary (12) -
to
_ bn (12) -
to
_ h (19) -
to
_ proc (12) -
to
_ s (24) - unbind (12)
-
undef
_ method (12) -
undefine
_ finalizer (12) - クラス/メソッドの定義 (12)
- パターンマッチ (12)
- メソッド呼び出し(super・ブロック付き・yield) (12)
- 制御構造 (12)
- 変数と定数 (12)
- 字句構造 (12)
検索結果
先頭5件
-
Object
# class -> Class (18262.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?... -
Class
# inherited(subclass) -> () (9142.0) -
クラスのサブクラスが定義された時、新しく生成されたサブクラスを引数 にインタプリタから呼び出されます。このメソッドが呼ばれるタイミングは クラス定義文の実行直前です。
...@param subclass プログラム内で新たに定義された自身のサブクラスです。
//emlist[例][ruby]{
class Foo
def Foo.inherited(subclass)
puts "class \"#{self}\" was inherited by \"#{subclass}\""
end
end
class Bar < Foo
puts "executing class body"
end
# => class "Foo" was......inherited by "Bar"
# executing class body
//}... -
TracePoint
# defined _ class -> Class | module (6256.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 の上記の差分に注... -
Module
# public _ class _ method(*name) -> self (6234.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...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 (6234.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...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
# private _ class _ method(*name) -> self (6228.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...mes 0 個以上の String または Symbol を Array で指定します。
//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_method_defined?(:foo) # => true
//}... -
Module
# private _ class _ method(names) -> self (6228.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...mes 0 個以上の String または Symbol を Array で指定します。
//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_method_defined?(:foo) # => true
//}... -
static VALUE superclass(VALUE self
, NODE *node) (6200.0) -
クラス文のスーパークラスを表すノード node を 評価してクラスを得ます。
クラス文のスーパークラスを表すノード node を
評価してクラスを得ます。 -
Module
# class _ eval {|mod| . . . } -> object (6150.0) -
モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。
...評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。
ただし、ローカル変数は module_eval/class_eval の外側のスコープと共有します。
定......きます。
//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m # メソッドを動的に定義できる。
return :m, #{a}
end
}
p C.new.m #=> [:m, 1]
//}
//emlist[定数のスコープが異なる例][ruby]{
class C
end
# ブロックが渡された......ルに定数 X を定義する。
C.class_eval { X = 1 }
# 文字列が渡された場合は、モジュール定義式内と同じスコープになる。つまり、この場合は
# class C
# X = 2
# end
# と書いたのと同じ意味になる。
C.class_eval 'X = 2'
p X #=> 1
p C::X #=>...