Module: Dnsimple::Default
- Defined in:
- lib/dnsimple/default.rb
Overview
Default configuration options for Client
Constant Summary collapse
- BASE_URL =
Default API endpoint
"https://api.dnsimple.com/"
- USER_AGENT =
Default User Agent header
"dnsimple-ruby/#{VERSION}".freeze
Class Method Summary collapse
-
.access_token ⇒ String
Default DNSimple access token for OAuth authentication from ENV.
-
.base_url ⇒ String
Default API endpoint from ENV or BASE_URL.
-
.domain_api_token ⇒ String
Default DNSimple Domain API Token for Token Auth from ENV.
-
.keys ⇒ Array
List of configurable keys for Client.
-
.options ⇒ Hash
Configuration options.
-
.password ⇒ String
Default DNSimple password for Basic Auth from ENV.
-
.proxy ⇒ String
Default Proxy address:port from ENV.
-
.user_agent ⇒ String
Default User-Agent header string from ENV.
-
.username ⇒ String
Default DNSimple username for Basic Auth from ENV.
Class Method Details
.access_token ⇒ String
Default DNSimple access token for OAuth authentication from ENV
55 56 57 |
# File 'lib/dnsimple/default.rb', line 55 def access_token ENV.fetch('DNSIMPLE_ACCESS_TOKEN', nil) end |
.base_url ⇒ String
Default API endpoint from ENV or BASE_URL
37 38 39 |
# File 'lib/dnsimple/default.rb', line 37 def base_url ENV.fetch('DNSIMPLE_BASE_URL', BASE_URL) end |
.domain_api_token ⇒ String
Default DNSimple Domain API Token for Token Auth from ENV
61 62 63 |
# File 'lib/dnsimple/default.rb', line 61 def domain_api_token ENV.fetch('DNSIMPLE_API_DOMAIN_TOKEN', nil) end |
.keys ⇒ Array
List of configurable keys for Client
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dnsimple/default.rb', line 17 def keys @keys ||= [ :base_url, :username, :password, :access_token, :domain_api_token, :user_agent, :proxy, ] end |
.options ⇒ Hash
Configuration options
31 32 33 |
# File 'lib/dnsimple/default.rb', line 31 def keys.to_h { |key| [key, send(key)] } end |
.password ⇒ String
Default DNSimple password for Basic Auth from ENV
49 50 51 |
# File 'lib/dnsimple/default.rb', line 49 def password ENV.fetch('DNSIMPLE_PASSWORD', nil) end |
.proxy ⇒ String
Default Proxy address:port from ENV
73 74 75 |
# File 'lib/dnsimple/default.rb', line 73 def proxy ENV.fetch('DNSIMPLE_PROXY', nil) end |
.user_agent ⇒ String
Default User-Agent header string from ENV
67 68 69 |
# File 'lib/dnsimple/default.rb', line 67 def user_agent ENV.fetch('DNSIMPLE_USER_AGENT', nil) end |
.username ⇒ String
Default DNSimple username for Basic Auth from ENV
43 44 45 |
# File 'lib/dnsimple/default.rb', line 43 def username ENV.fetch('DNSIMPLE_USERNAME', nil) end |