Sha256: 6d5d4deef6edad5817af81f92b99a5b56c56bf395e2018d35b6c4755409c38f7

Contents?: true

Size: 725 Bytes

Versions: 5

Compression:

Stored size: 725 Bytes

Contents

require "fastly-rails/engine"
require "fastly-rails/client"
require "fastly-rails/configuration"
require "fastly-rails/errors"

module FastlyRails

  attr_reader :client, :configuration

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield configuration if block_given?
  end

  def self.service_id
    raise NoServiceIdProvidedError if configuration.invalid_service_id?
    configuration.service_id
  end

  def self.client
    raise NoAuthCredentialsProvidedError unless configuration.authenticatable?

    @client ||= Client.new(
      :api_key  => configuration.api_key,
      :user     => configuration.user,
      :password => configuration.password,
    )
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fastly-rails-0.1.7 lib/fastly-rails.rb
fastly-rails-0.1.6 lib/fastly-rails.rb
fastly-rails-0.1.5 lib/fastly-rails.rb
fastly-rails-0.1.4 lib/fastly-rails.rb
fastly-rails-0.1.3 lib/fastly-rails.rb