class Frodo::PropertyRegistry

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

Public Class Methods

[](type_name) click to toggle source

(see [])

# File lib/frodo/property_registry.rb, line 31
def self.[](type_name)
  Frodo::PropertyRegistry.instance[type_name]
end
add(type_name, klass) click to toggle source

(see add)

# File lib/frodo/property_registry.rb, line 26
def self.add(type_name, klass)
  Frodo::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/frodo/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/frodo/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/frodo/property_registry.rb, line 37
def properties
  @properties ||= {}
end