Class: Synapse::Serialization::IdentityConverter

Inherits:
Object
  • Object
show all
Includes:
Converter
Defined in:
lib/synapse/serialization/converter/identity.rb

Overview

Implementation of a converter that does no conversion

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ undefined

Parameters:

  • type (Class)


12
13
14
# File 'lib/synapse/serialization/converter/identity.rb', line 12

def initialize(type)
  @source_type = @target_type = type
end

Instance Attribute Details

#source_typeObject (readonly)

Returns the value of attribute source_type.



7
8
9
# File 'lib/synapse/serialization/converter/identity.rb', line 7

def source_type
  @source_type
end

#target_typeObject (readonly)

Returns the value of attribute target_type.



8
9
10
# File 'lib/synapse/serialization/converter/identity.rb', line 8

def target_type
  @target_type
end

Instance Method Details

#convert(original) ⇒ SerializedObject

Parameters:

Returns:



18
19
20
# File 'lib/synapse/serialization/converter/identity.rb', line 18

def convert(original)
  original
end

#convert_content(original) ⇒ Object

Parameters:

  • original (Object)

Returns:

  • (Object)


24
25
26
# File 'lib/synapse/serialization/converter/identity.rb', line 24

def convert_content(original)
  original
end