edge badge
Methods
D
N
S
Constants
MARSHAL_SIGNATURE = "\x04\x08".freeze
 
Instance Protected methods
deserialize(name, value)
# File actionpack/lib/action_dispatch/middleware/cookies.rb, line 421
def deserialize(name, value)
  if value
    if needs_migration?(value)
      Marshal.load(value).tap do |v|
        self[name] = { value: v }
      end
    else
      serializer.load(value)
    end
  end
end
needs_migration?(value)
# File actionpack/lib/action_dispatch/middleware/cookies.rb, line 413
def needs_migration?(value)
  @options[:serializer] == :hybrid && value.start_with?(MARSHAL_SIGNATURE)
end
serialize(name, value)
# File actionpack/lib/action_dispatch/middleware/cookies.rb, line 417
def serialize(name, value)
  serializer.dump(value)
end
serializer()
# File actionpack/lib/action_dispatch/middleware/cookies.rb, line 433
def serializer
  serializer = @options[:serializer] || :marshal
  case serializer
  when :marshal
    Marshal
  when :json, :hybrid
    JsonSerializer
  else
    serializer
  end
end