Module: ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Defined in: | activesupport/lib/active_support/messages/serializer_with_fallback.rb |
Constant Summary
-
JSON_START_WITH =
# File 'activesupport/lib/active_support/messages/serializer_with_fallback.rb', line 94/\A(?:[{\["]|-?\d|true|false|null)/
::ActiveSupport::Messages::SerializerWithFallback
- Included
Instance Method Summary
Instance Method Details
#_load(dumped)
[ GitHub ]# File 'activesupport/lib/active_support/messages/serializer_with_fallback.rb', line 90
def _load(dumped) ActiveSupport::JSON.decode(dumped) end
#detect_format(dumped) (private)
[ GitHub ]# File 'activesupport/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
#dump(object)
[ GitHub ]# File 'activesupport/lib/active_support/messages/serializer_with_fallback.rb', line 86
def dump(object) ActiveSupport::JSON.encode(object) end
#dumped?(dumped) ⇒ Boolean
# File 'activesupport/lib/active_support/messages/serializer_with_fallback.rb', line 96
def dumped?(dumped) JSON_START_WITH.match?(dumped) end
#format
[ GitHub ]# File 'activesupport/lib/active_support/messages/serializer_with_fallback.rb', line 82
def format :json end