module Hyperkit::Default

Default configuration options for {Client}

Constants

API_ENDPOINT

Default API endpoint

AUTO_SYNC

Default auto-sync value

CLIENT_CERT

Default client certificate file for authentication

CLIENT_KEY

Default client key file for authentication

MEDIA_TYPE

Default media type

MIDDLEWARE

Default Faraday middleware stack

RACK_BUILDER_CLASS

In Faraday 0.9, Faraday::Builder was renamed to Faraday::RackBuilder

USER_AGENT

Default User Agent header string

VERIFY_SSL

Default to verifying SSL certificates

Public Class Methods

api_endpoint() click to toggle source

Default API endpoint from ENV or {API_ENDPOINT} @return [String]

# File lib/hyperkit/default.rb, line 90
def api_endpoint
  ENV['HYPERKIT_API_ENDPOINT'] || API_ENDPOINT
end
auto_sync() click to toggle source

Default auto-sync value from ENV or {AUTO_SYNC}

# File lib/hyperkit/default.rb, line 95
def auto_sync
  ENV['HYPERKIT_AUTO_SYNC'] || AUTO_SYNC
end
client_cert() click to toggle source

Default client certificate file from ENV or {CLIENT_CERT} @return [String]

# File lib/hyperkit/default.rb, line 101
def client_cert
  ENV['HYPERKIT_CLIENT_CERT'] || CLIENT_CERT
end
client_key() click to toggle source

Default client key file from ENV or {CLIENT_KEY} @return [String]

# File lib/hyperkit/default.rb, line 107
def client_key
  ENV['HYPERKIT_KEY'] || CLIENT_KEY
end
connection_options() click to toggle source

Default options for Faraday::Connection @return [Hash]

# File lib/hyperkit/default.rb, line 66
def connection_options
  {
    :headers => {
      :accept => default_media_type,
      :user_agent => user_agent,
    },
    :ssl => {}
  }
end
default_media_type() click to toggle source

Default media type from ENV or {MEDIA_TYPE} @return [String]

# File lib/hyperkit/default.rb, line 78
def default_media_type
  ENV['HYPERKIT_DEFAULT_MEDIA_TYPE'] || MEDIA_TYPE
end
middleware() click to toggle source

Default middleware stack for Faraday::Connection from {MIDDLEWARE} @return [String]

# File lib/hyperkit/default.rb, line 114
def middleware
  MIDDLEWARE
end
options() click to toggle source

Configuration options @return [Hash]

# File lib/hyperkit/default.rb, line 84
def options
  Hash[Hyperkit::Configurable.keys.map{|key| [key, send(key)]}]
end
proxy() click to toggle source

Default proxy server URI for Faraday connection from ENV @return [String]

# File lib/hyperkit/default.rb, line 120
def proxy
  ENV['HYPERKIT_PROXY']
end
user_agent() click to toggle source

Default User-Agent header string from ENV or {USER_AGENT} @return [String]

# File lib/hyperkit/default.rb, line 126
def user_agent
  ENV['HYPERKIT_USER_AGENT'] || USER_AGENT
end
verify_ssl() click to toggle source

Default to verifying peer SSL certificate @return [Boolean]

# File lib/hyperkit/default.rb, line 132
def verify_ssl
  true
end