Module: ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback

Extended by:
MarshalWithFallback
Includes:
ActiveSupport::Messages::SerializerWithFallback
Included in:
MarshalWithFallback
Defined in:
lib/active_support/messages/serializer_with_fallback.rb

Constant Summary collapse

MARSHAL_SIGNATURE =
"\x04\x08"

Instance Method Summary collapse

Methods included from ActiveSupport::Messages::SerializerWithFallback

[], #load

Instance Method Details

#_load(dumped) ⇒ Object



67
68
69
# File 'lib/active_support/messages/serializer_with_fallback.rb', line 67

def _load(dumped)
  Marshal.load(dumped)
end

#dump(object) ⇒ Object



63
64
65
# File 'lib/active_support/messages/serializer_with_fallback.rb', line 63

def dump(object)
  Marshal.dump(object)
end

#dumped?(dumped) ⇒ Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/active_support/messages/serializer_with_fallback.rb', line 73

def dumped?(dumped)
  dumped.start_with?(MARSHAL_SIGNATURE)
end

#formatObject



59
60
61
# File 'lib/active_support/messages/serializer_with_fallback.rb', line 59

def format
  :marshal
end