List of serializeable classes
Add a class to the list
klass - Class to add, must provide ::TYPE constant
# File lib/onapp_market/api/serialize.rb, line 293 def self.add(klass) # Note we could use the Ruby class name (rather than type), but we want # the serialization to be portable raise "No TYPE constant defined" unless klass.const_defined? :TYPE @@list[klass::TYPE] = klass end
Get the class for a given type
type - The type
Class or nil
# File lib/onapp_market/api/serialize.rb, line 310 def self.get(type) @@list[type] end
Get list of classes
Hash of classes and type
# File lib/onapp_market/api/serialize.rb, line 302 def self.list @@list end