Class: ClusterId::V1::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/clusterid/v1/serialization.rb

Overview

The abstract base class of all custom serialization logic.

Since:

  • 1.0.0

Direct Known Subclasses

NullSerializer

Instance Method Summary collapse

Instance Method Details

#from_data_centre(t) ⇒ Integer

Returns the serialized data centre.

Parameters:

  • t (T)

    the data centre

Returns:

  • (Integer)

    the serialized data centre

Raises:

  • (NotImplementedError)

Since:

  • 1.0.0



15
16
17
# File 'lib/clusterid/v1/serialization.rb', line 15

def from_data_centre(t)
  raise NotImplementedError
end

#from_environment(t) ⇒ Integer

Returns the serialized environment.

Parameters:

  • t (T)

    the environment

Returns:

  • (Integer)

    the serialized environment

Raises:

  • (NotImplementedError)

Since:

  • 1.0.0



9
10
11
# File 'lib/clusterid/v1/serialization.rb', line 9

def from_environment(t)
  raise NotImplementedError
end

#from_type_id(t) ⇒ Integer

Returns the serialized type ID.

Parameters:

  • t (T)

    the type ID

Returns:

  • (Integer)

    the serialized type ID

Raises:

  • (NotImplementedError)

Since:

  • 1.0.0



21
22
23
# File 'lib/clusterid/v1/serialization.rb', line 21

def from_type_id(t)
  raise NotImplementedError
end