Class: FastlyRails::Client

Inherits:
Fastly
  • Object
show all
Defined in:
lib/fastly-rails/client.rb

Overview

A simple wrapper around the fastly-ruby client.

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Client

Returns a new instance of Client.


7
8
9
# File 'lib/fastly-rails/client.rb', line 7

def initialize(opts={})
  super(Fastly.new(opts))
end

Instance Method Details

#purge_by_key(*args) ⇒ Object


11
12
13
# File 'lib/fastly-rails/client.rb', line 11

def purge_by_key(*args)
  Fastly::Service.new({id: FastlyRails.service_id}, FastlyRails.client).purge_by_key(*args)
end

#purge_url(key) ⇒ Object


15
16
17
# File 'lib/fastly-rails/client.rb', line 15

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