るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.019秒)
トップページ > クエリ:singleton[x] > ライブラリ:singleton[x]

別のキーワード

  1. singleton dup
  2. singleton clone
  3. singleton instance
  4. object define_singleton_method
  5. _builtin define_singleton_method

モジュール

キーワード

検索結果

Singleton.instance -> object (17014.0)

そのクラスの唯一のインスタンスを返します。 最初に呼ばれたときはそのインスタンスを生成します。

...そのクラスの唯一のインスタンスを返します。
最初に呼ばれたときはそのインスタンスを生成します。

Singleton
を include したクラスで定義されますので、
正確には Singleton モジュールのメソッドではありません。...

Singleton#clone (17002.0)

@raise TypeError このメソッドを呼び出した場合に発生します。

@raise TypeError このメソッドを呼び出した場合に発生します。

Singleton#dup (17002.0)

@raise TypeError このメソッドを呼び出した場合に発生します。

@raise TypeError このメソッドを呼び出した場合に発生します。

Singleton (14048.0)

Singleton パターンを提供するモジュールです。

...Singleton パターンを提供するモジュールです。

Mix-in により singleton パターンを提供します。

Singleton
モジュールを include することにより、クラスは
高々ひとつのインスタンスしか持たないことが保証されます。

Singleton
を M...
...ire '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)...