Sha256: c7ccbc2d12fc46cfe617b8dd24ae860244f1339e728efa3f6bc5128bec353b2a

Contents?: true

Size: 386 Bytes

Versions: 5

Compression:

Stored size: 386 Bytes

Contents

require 'fastly'

module FastlyRails
  # A simple wrapper around the fastly-ruby client.
  class Client < DelegateClass(Fastly)
    def initialize(opts={})
      super(Fastly.new(opts))
    end

    def purge_by_key(key)
      client.require_key!
      client.post purge_url(key)
    end

    def purge_url(key)
      "/service/#{FastlyRails.service_id}/purge/#{key}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fastly-rails-0.5.0 lib/fastly-rails/client.rb
fastly-rails-0.4.1 lib/fastly-rails/client.rb
fastly-rails-0.4.0 lib/fastly-rails/client.rb
fastly-rails-0.3.0 lib/fastly-rails/client.rb
fastly-rails-0.2.0 lib/fastly-rails/client.rb