Class: ActionDispatch::Cookies::JsonSerializer

Inherits:
Object
  • Object
show all
Defined in:
actionpack/lib/action_dispatch/middleware/cookies.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.dump(value) ⇒ Object



565
566
567
# File 'actionpack/lib/action_dispatch/middleware/cookies.rb', line 565

def self.dump(value)
  ActiveSupport::JSON.encode(value)
end

.load(value) ⇒ Object



559
560
561
562
563
# File 'actionpack/lib/action_dispatch/middleware/cookies.rb', line 559

def self.load(value)
  ActiveSupport::JSON.decode(value)
rescue JSON::ParserError
  nil
end