Class: OData::PropertyRegistry

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/odata/property_registry.rb

Overview

Provides a registry for keeping track of various property types used by OData.

Class Method Summary collapse

Instance Method Summary collapse

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/odata/property_registry.rb', line 31

def self.[](type_name)
  OData::PropertyRegistry.instance[type_name]
end

.add(type_name, klass) ⇒ Object

Add a property type to the registry



26
27
28
# File 'lib/odata/property_registry.rb', line 26

def self.add(type_name, klass)
  OData::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/odata/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/odata/property_registry.rb', line 13

def add(type_name, klass)
  properties[type_name] = klass
end