class Purging::Images::Cache

Public Class Methods

new(options) click to toggle source
# File lib/purging/images.rb, line 9
def initialize(options)
  url = options[:url]
  api_key = options[:api_key]
  @options = { body: { url: url }, basic_auth: { username: api_key, password: '' } }
end

Public Instance Methods

call() click to toggle source
# File lib/purging/images.rb, line 15
def call
  purge = self.class.post('/image/purger'.freeze, @options)
  purge.success?
rescue Errno::ECONNRESET, SocketError
  { 'status' => 'failed' }
end