Class: Jerakia::Policy::Registry
- Inherits:
-
Object
- Object
- Jerakia::Policy::Registry
- Defined in:
- lib/jerakia/policy/registry.rb
Class Attribute Summary collapse
-
.instances ⇒ Object
readonly
Returns the value of attribute instances.
Instance Attribute Summary collapse
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, instance) ⇒ Registry
constructor
A new instance of Registry.
Constructor Details
#initialize(name, instance) ⇒ Registry
Returns a new instance of Registry.
17 18 19 20 |
# File 'lib/jerakia/policy/registry.rb', line 17 def initialize(name, instance) @instance = instance self.class.register(name, self) end |
Class Attribute Details
.instances ⇒ Object (readonly)
Returns the value of attribute instances.
8 9 10 |
# File 'lib/jerakia/policy/registry.rb', line 8 def instances @instances end |
Instance Attribute Details
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
15 16 17 |
# File 'lib/jerakia/policy/registry.rb', line 15 def instance @instance end |
Class Method Details
.register(name, instance) ⇒ Object
10 11 12 |
# File 'lib/jerakia/policy/registry.rb', line 10 def register(name, instance) @instances[name] = instance unless @instances[name] end |