6件ヒット
[1-6件を表示]
(0.116秒)
ライブラリ
- forwardable (1)
- json (2)
- monitor (1)
- resolv (1)
- singleton (1)
キーワード
- IN (1)
- MonitorMixin (1)
- NilClass (2)
- SingleForwardable (1)
- Singleton (1)
検索結果
先頭5件
-
JSON
:: Ext :: Generator :: GeneratorMethods :: NilClass (36004.0) -
Alias of JSON::Generator::GeneratorMethods::NilClass
Alias of JSON::Generator::GeneratorMethods::NilClass -
JSON
:: Generator :: GeneratorMethods :: NilClass (36004.0) -
NilClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
NilClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
Singleton (18040.0)
-
Singleton パターンを提供するモジュールです。
Singleton パターンを提供するモジュールです。
Mix-in により singleton パターンを提供します。
Singleton モジュールを include することにより、クラスは
高々ひとつのインスタンスしか持たないことが保証されます。
Singleton を Mix-in したクラスの
クラスメソッド instance はその唯一のインスタンスを返します。
new は private メソッドに移され、外部から呼び出そうとするとエラーになります。
=== サンプルコード
require 'singleton'
class SomeSingletonCl... -
MonitorMixin (18022.0)
-
スレッドの同期機構としてのモニター機能を提供するモジュールです。
...スレッドの同期機構としてのモニター機能を提供するモジュールです。
クラスに Module#include したり、オブジェクトに
Object#extend したりすることでそのクラス/オブジェクトに
モニタ機能を追加します。
=== 例
//emlist[消費......//emlist[extend する例][ruby]{
require 'monitor'
buf = []
buf.extend(MonitorMixin)
//}
しかし、MonitorMixin をクラス定義の際に Module#include を使って
利用する場合は、initialize メソッドで super() か super を呼んで、初期化する必要があります。... -
Resolv
:: DNS :: Resource :: IN (18022.0) -
DNS のインターネットクラスリソースを表すモジュールです。
DNS のインターネットクラスリソースを表すモジュールです。
インターネットクラスリソースを利用する class に
mixinして利用します。 -
SingleForwardable (18022.0)
-
オブジェクトに対し、メソッドの委譲機能を定義するモジュールです。
...ようにする事もできます。
require 'forwardable'
class Implementation
def self.service
puts "serviced!"
end
end
module Facade
extend SingleForwardable
def_delegator :Implementation, :service
end
Facade.service # => serviced!
もし Forwardable と Si...