class OData4::PropertyRegistry
Provides a registry for keeping track of various property types used by OData4
.
Public Class Methods
[](type_name)
click to toggle source
(see []
)
# File lib/odata4/property_registry.rb, line 31 def self.[](type_name) OData4::PropertyRegistry.instance[type_name] end
add(type_name, klass)
click to toggle source
(see add
)
# File lib/odata4/property_registry.rb, line 26 def self.add(type_name, klass) OData4::PropertyRegistry.instance.add(type_name, klass) end
Public Instance Methods
[](type_name)
click to toggle source
Lookup a property by name and get the Ruby class to use for its instances
@param type_name [String] the type name to lookup @return [Class, nil] the proper class or nil
# File lib/odata4/property_registry.rb, line 21 def [](type_name) properties[type_name] end
add(type_name, klass)
click to toggle source
Add a property type to the registry
@param type_name [String] property type name to register @param klass [Class] Ruby class to use for the specified type
# File lib/odata4/property_registry.rb, line 13 def add(type_name, klass) properties[type_name] = klass end
Private Instance Methods
properties()
click to toggle source
# File lib/odata4/property_registry.rb, line 37 def properties @properties ||= {} end