lib/fastly/client.rb in fastly-1.4.3 vs lib/fastly/client.rb in fastly-1.5.0
- old
+ new
@@ -4,19 +4,22 @@
require 'openssl'
class Fastly
# The UserAgent to communicate with the API
class Client #:nodoc: all
+
+ DEFAULT_URL = 'https://api.fastly.com'.freeze
+
attr_accessor :http, :api_key, :user, :password, :cookie, :customer
def initialize(opts)
@api_key = opts.fetch(:api_key, nil)
@user = opts.fetch(:user, nil)
@password = opts.fetch(:password, nil)
@customer = opts.fetch(:customer, nil)
@oldpurge = opts.fetch(:use_old_purge_method, false)
- base = opts.fetch(:base_url, 'https://api.fastly.com')
+ base = opts.fetch(:base_url, DEFAULT_URL)
uri = URI.parse(base)
options = if uri.is_a? URI::HTTPS
{
use_ssl: true,
verify_mode: OpenSSL::SSL::VERIFY_PEER