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
56 57 58 |
# File 'lib/dnsimple/default.rb', line 56 def access_token ENV.fetch('DNSIMPLE_ACCESS_TOKEN', nil) end |
.base_url ⇒ String
Default API endpoint from ENV or BASE_URL
38 39 40 |
# File 'lib/dnsimple/default.rb', line 38 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
62 63 64 |
# File 'lib/dnsimple/default.rb', line 62 def domain_api_token ENV.fetch('DNSIMPLE_API_DOMAIN_TOKEN', nil) end |
.keys ⇒ Array
List of configurable keys for Client
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dnsimple/default.rb', line 18 def keys @keys ||= [ :base_url, :username, :password, :access_token, :domain_api_token, :user_agent, :proxy, ] end |
.options ⇒ Hash
Configuration options
32 33 34 |
# File 'lib/dnsimple/default.rb', line 32 def keys.to_h { |key| [key, send(key)] } end |
.password ⇒ String
Default DNSimple password for Basic Auth from ENV
50 51 52 |
# File 'lib/dnsimple/default.rb', line 50 def password ENV.fetch('DNSIMPLE_PASSWORD', nil) end |
.proxy ⇒ String
Default Proxy address:port from ENV
74 75 76 |
# File 'lib/dnsimple/default.rb', line 74 def proxy ENV.fetch('DNSIMPLE_PROXY', nil) end |
.user_agent ⇒ String
Default User-Agent header string from ENV
68 69 70 |
# File 'lib/dnsimple/default.rb', line 68 def user_agent ENV.fetch('DNSIMPLE_USER_AGENT', nil) end |
.username ⇒ String
Default DNSimple username for Basic Auth from ENV
44 45 46 |
# File 'lib/dnsimple/default.rb', line 44 def username ENV.fetch('DNSIMPLE_USERNAME', nil) end |