Module: Dnsimple::Default
- Defined in:
- lib/dnsimple/default.rb
Overview
Default configuration options for Client
Constant Summary collapse
- API_ENDPOINT =
Default API endpoint
"https://api.dnsimple.com/".freeze
- USER_AGENT =
Default User Agent header
"dnsimple-ruby/#{VERSION}".freeze
Class Method Summary collapse
-
.api_endpoint ⇒ String
Default API endpoint from ENV or API_ENDPOINT.
-
.api_token ⇒ String
Default DNSimple API Token for Token Auth from ENV.
-
.domain_api_token ⇒ String
Default DNSimple Domain API Token for Token Auth from ENV.
-
.exchange_token ⇒ String
Default DNSimple Exchange Token for Basic 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 or USER_AGENT.
-
.username ⇒ String
Default DNSimple username for Basic Auth from ENV.
Class Method Details
.api_endpoint ⇒ String
Default API endpoint from ENV or API_ENDPOINT
37 38 39 |
# File 'lib/dnsimple/default.rb', line 37 def api_endpoint ENV['DNSIMPLE_API_ENDPOINT'] || API_ENDPOINT end |
.api_token ⇒ String
Default DNSimple API Token for Token Auth from ENV
67 68 69 |
# File 'lib/dnsimple/default.rb', line 67 def api_token ENV['DNSIMPLE_API_TOKEN'] 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['DNSIMPLE_API_DOMAIN_TOKEN'] end |
.exchange_token ⇒ String
Default DNSimple Exchange Token for Basic Auth from ENV
55 56 57 |
# File 'lib/dnsimple/default.rb', line 55 def exchange_token ENV['DNSIMPLE_API_EXCHANGE_TOKEN'] end |
.keys ⇒ Array
List of configurable keys for Client
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dnsimple/default.rb', line 16 def keys @keys ||= [ :api_endpoint, :username, :password, :exchange_token, :api_token, :domain_api_token, :user_agent, :proxy, ] end |
.options ⇒ Hash
Configuration options
31 32 33 |
# File 'lib/dnsimple/default.rb', line 31 def Hash[keys.map { |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['DNSIMPLE_PASSWORD'] end |
.proxy ⇒ String
Default Proxy address:port from ENV
79 80 81 |
# File 'lib/dnsimple/default.rb', line 79 def proxy ENV['DNSIMPLE_PROXY'] end |
.user_agent ⇒ String
Default User-Agent header string from ENV or USER_AGENT
73 74 75 |
# File 'lib/dnsimple/default.rb', line 73 def user_agent ENV['DNSIMPLE_USER_AGENT'] || USER_AGENT end |
.username ⇒ String
Default DNSimple username for Basic Auth from ENV
43 44 45 |
# File 'lib/dnsimple/default.rb', line 43 def username ENV['DNSIMPLE_USERNAME'] end |