class Garner::Strategies::Context::Key::Jsonp

Public Class Methods

apply(identity, ruby_context = nil) click to toggle source

Strips JSONP parameters from the key.

@param identity [Garner::Cache::Identity] The cache identity. @param ruby_context [Object] An optional Ruby context. @return [Garner::Cache::Identity] The modified identity.

# File lib/garner/strategies/context/key/jsonp.rb, line 15
def self.apply(identity, ruby_context = nil)
  key_hash = identity.key_hash
  return super unless key_hash[field]

  key_hash[field].delete('callback')
  key_hash[field].delete('_')
  identity
end
field() click to toggle source
# File lib/garner/strategies/context/key/jsonp.rb, line 6
def self.field
  :request_params
end