module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback

Constants

JSON_START_WITH

Public Instance Methods

_load(dumped) click to toggle source
# File lib/active_support/messages/serializer_with_fallback.rb, line 90
def _load(dumped)
  ActiveSupport::JSON.decode(dumped)
end
dump(object) click to toggle source
# File lib/active_support/messages/serializer_with_fallback.rb, line 86
def dump(object)
  ActiveSupport::JSON.encode(object)
end
dumped?(dumped) click to toggle source
# File lib/active_support/messages/serializer_with_fallback.rb, line 96
def dumped?(dumped)
  JSON_START_WITH.match?(dumped)
end
format() click to toggle source
# File lib/active_support/messages/serializer_with_fallback.rb, line 82
def format
  :json
end

Private Instance Methods

detect_format(dumped) click to toggle source
Calls superclass method
# File lib/active_support/messages/serializer_with_fallback.rb, line 101
def detect_format(dumped)
  # Assume JSON format if format could not be determined.
  super || :json
end