Class: Synapse::Serialization::DeserializedObject

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse/serialization/lazy_object.rb

Overview

Deserialized object that has (nearly) the same interface as a lazy object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deserialized) ⇒ undefined

Parameters:

  • deserialized (Object)


49
50
51
52
# File 'lib/synapse/serialization/lazy_object.rb', line 49

def initialize(deserialized)
  @deserialized = deserialized
  @type = deserialized.class
end

Instance Attribute Details

#deserializedObject (readonly)

Returns:

  • (Object)


39
40
41
# File 'lib/synapse/serialization/lazy_object.rb', line 39

def deserialized
  @deserialized
end

#serializerSerializer (readonly)

Returns This will always be nil.

Returns:



42
43
44
# File 'lib/synapse/serialization/lazy_object.rb', line 42

def serializer
  @serializer
end

#typeClass (readonly)

Returns:

  • (Class)


45
46
47
# File 'lib/synapse/serialization/lazy_object.rb', line 45

def type
  @type
end

Instance Method Details

#deserialized?Boolean

Returns true if this object has been deserialized already; always true

Returns:

  • (Boolean)


56
57
58
# File 'lib/synapse/serialization/lazy_object.rb', line 56

def deserialized?
  true
end