Class: FrOData::PropertyRegistry
- Inherits:
-
Object
- Object
- FrOData::PropertyRegistry
- Includes:
- Singleton
- Defined in:
- lib/frodata/property_registry.rb
Overview
Provides a registry for keeping track of various property types used by FrOData.
Class Method Summary collapse
-
.[](type_name) ⇒ Class?
Lookup a property by name and get the Ruby class to use for its instances.
-
.add(type_name, klass) ⇒ Object
Add a property type to the registry.
Instance Method Summary collapse
-
#[](type_name) ⇒ Class?
Lookup a property by name and get the Ruby class to use for its instances.
-
#add(type_name, klass) ⇒ Object
Add a property type to the registry.
Class Method Details
.[](type_name) ⇒ Class?
Lookup a property by name and get the Ruby class to use for its instances
31 32 33 |
# File 'lib/frodata/property_registry.rb', line 31 def self.[](type_name) FrOData::PropertyRegistry.instance[type_name] end |
.add(type_name, klass) ⇒ Object
Add a property type to the registry
26 27 28 |
# File 'lib/frodata/property_registry.rb', line 26 def self.add(type_name, klass) FrOData::PropertyRegistry.instance.add(type_name, klass) end |
Instance Method Details
#[](type_name) ⇒ Class?
Lookup a property by name and get the Ruby class to use for its instances
21 22 23 |
# File 'lib/frodata/property_registry.rb', line 21 def [](type_name) properties[type_name] end |
#add(type_name, klass) ⇒ Object
Add a property type to the registry
13 14 15 |
# File 'lib/frodata/property_registry.rb', line 13 def add(type_name, klass) properties[type_name] = klass end |