class Dynflow::Flows::Registry
Public Class Methods
decode(identifier)
click to toggle source
# File lib/dynflow/flows/registry.rb, line 23 def decode(identifier) serialization_map[identifier] || raise(UnknownIdentifier, "Could not find mapping for #{identifier}") end
encode(klass)
click to toggle source
# File lib/dynflow/flows/registry.rb, line 18 def encode(klass) klass = klass.class unless klass.is_a?(Class) serialization_map.invert[klass] || raise(UnknownIdentifier, "Could not find mapping for #{klass}") end
register!(klass, identifier)
click to toggle source
# File lib/dynflow/flows/registry.rb, line 10 def register!(klass, identifier) if (found = serialization_map[identifier]) raise IdentifierTaken, "Error setting up mapping #{identifier} to #{klass}, it already maps to #{found}" else serialization_map.update(identifier => klass) end end
serialization_map()
click to toggle source
# File lib/dynflow/flows/registry.rb, line 27 def serialization_map @serialization_map ||= {} end