class OnappMarket::API::Classes

List of serializeable classes

Public Class Methods

add(klass) click to toggle source

Add a class to the list

Attributes

  • 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(type) click to toggle source

Get the class for a given type

Attributes

  • type - The type

Returns

  • Class or nil

# File lib/onapp_market/api/serialize.rb, line 310
def self.get(type)
  @@list[type]
end
list() click to toggle source

Get list of classes

Returns

Hash of classes and type

# File lib/onapp_market/api/serialize.rb, line 302
def self.list
  @@list
end