450件ヒット
[1-100件を表示]
(0.104秒)
ライブラリ
- ビルトイン (246)
- forwardable (44)
- profiler (6)
-
rdoc
/ context (11) - singleton (44)
クラス
- Array (22)
- BasicObject (33)
- Hash (22)
- Module (59)
- Object (110)
-
RDoc
:: Context (11)
モジュール
- SingleForwardable (44)
- Singleton (33)
キーワード
-
Profiler
_ _ (6) - Ruby用語集 (11)
- Singleton (11)
- clone (33)
-
def
_ delegator (11) -
def
_ delegators (11) -
def
_ single _ delegator (11) -
def
_ single _ delegators (11) -
define
_ singleton _ method (22) - dup (33)
-
initialize
_ copy (11) - instance (11)
-
irb
/ completion (11) -
method
_ added (11) -
method
_ removed (11) -
method
_ undefined (11) - methods (11)
-
private
_ class _ method (15) -
private
_ methods (11) -
protected
_ methods (11) -
public
_ methods (11) -
rb
_ define _ singleton _ method (11) -
rb
_ obj _ singleton _ methods (11) -
rb
_ singleton _ class (11) -
rb
_ singleton _ class _ attached (11) -
rb
_ singleton _ class _ clone (11) -
rb
_ singleton _ class _ new (11) -
set
_ visibility _ for (11) -
singleton
_ class (11) -
singleton
_ class? (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11)
検索結果
-
singleton (44016.0)
-
Singleton パターンを扱うためのライブラリです。
...Singleton パターンを扱うためのライブラリです。... -
Singleton
# clone (23100.0) -
@raise TypeError このメソッドを呼び出した場合に発生します。
@raise TypeError このメソッドを呼び出した場合に発生します。 -
Singleton (20046.0)
-
Singleton パターンを提供するモジュールです。
...Singleton パターンを提供するモジュールです。
Mix-in により singleton パターンを提供します。
Singleton モジュールを include することにより、クラスは
高々ひとつのインスタンスしか持たないことが保証されます。
Singleton を M......re 'singleton'
class SomeSingletonClass
include Singleton
#....
end
a = SomeSingletonClass.instance
b = SomeSingletonClass.instance # a and b are same object
p [a,b] # => [#<SomeSingletonClass:0x0000562e6e18ddd0>, #<SomeSingletonClass:0x0000562e6e18ddd0>]
a = SomeSingletonClass.......new # => NoMethodError (private method `new' called for SomeSingletonClass:Class)... -
Singleton
. instance -> object (20012.0) -
そのクラスの唯一のインスタンスを返します。 最初に呼ばれたときはそのインスタンスを生成します。
...そのクラスの唯一のインスタンスを返します。
最初に呼ばれたときはそのインスタンスを生成します。
Singleton を include したクラスで定義されますので、
正確には Singleton モジュールのメソッドではありません。... -
Singleton
# dup (20000.0) -
@raise TypeError このメソッドを呼び出した場合に発生します。
@raise TypeError このメソッドを呼び出した場合に発生します。 -
Module
# singleton _ class? -> bool (15219.0) -
self が特異クラスの場合に true を返します。そうでなければ false を返し ます。
...self が特異クラスの場合に true を返します。そうでなければ false を返し
ます。
//emlist[例][ruby]{
class C
end
C.singleton_class? # => false
C.singleton_class.singleton_class? # => true
//}... -
SingleForwardable
# def _ single _ delegator(accessor , method , ali = method) -> () (15206.0) -
メソッドの委譲先を設定します。
...メソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。
委譲元と委譲先のメソッド名が同じ場合は, ali を省略するこ......とが可能です。
def_delegator は def_singleton_delegator の別名になります。
@see SingleForwardable#def_delegators... -
SingleForwardable
# def _ single _ delegators(accessor , *methods) -> () (15206.0) -
メソッドの委譲先をまとめて設定します。
...delegators は def_singleton_delegators の別名になります。
また、以下の 2 つの例は同じ意味です。
def_delegators :@records, :size, :<<, :map
def_delegator :@records, :size
def_delegator :@records, :<<
def_delegator :@records, :map
@see SingleForwardable#def_deleg... -
VALUE rb
_ obj _ singleton _ methods(int argc , VALUE *argv , VALUE obj) (12416.0) -
Object#singleton_methods の実体。 オブジェクト obj に定義されている特異メソッド名のリストを 文字列の配列で返す。
...Object#singleton_methods の実体。
オブジェクト obj に定義されている特異メソッド名のリストを
文字列の配列で返す。... -
VALUE rb
_ singleton _ class(VALUE obj) (12300.0) -
obj に特異クラスを導入し、その特異クラスを返します。 すでに特異クラスが導入されているときはそれをそのまま返します。
obj に特異クラスを導入し、その特異クラスを返します。
すでに特異クラスが導入されているときはそれをそのまま返します。
obj が特異メソッドを定義できない型のオブジェクトである
ときは例外 TypeError を発生します。