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/".freeze
- 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
54 55 56 |
# File 'lib/dnsimple/default.rb', line 54 def access_token ENV['DNSIMPLE_ACCESS_TOKEN'] end |
.base_url ⇒ String
Default API endpoint from ENV or BASE_URL
36 37 38 |
# File 'lib/dnsimple/default.rb', line 36 def base_url ENV['DNSIMPLE_BASE_URL'] || BASE_URL end |
.domain_api_token ⇒ String
Default DNSimple Domain API Token for Token Auth from ENV
60 61 62 |
# File 'lib/dnsimple/default.rb', line 60 def domain_api_token ENV['DNSIMPLE_API_DOMAIN_TOKEN'] end |
.keys ⇒ Array
List of configurable keys for Client
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dnsimple/default.rb', line 16 def keys @keys ||= [ :base_url, :username, :password, :access_token, :domain_api_token, :user_agent, :proxy, ] end |
.options ⇒ Hash
Configuration options
30 31 32 |
# File 'lib/dnsimple/default.rb', line 30 def Hash[keys.map { |key| [key, send(key)] }] end |
.password ⇒ String
Default DNSimple password for Basic Auth from ENV
48 49 50 |
# File 'lib/dnsimple/default.rb', line 48 def password ENV['DNSIMPLE_PASSWORD'] end |
.proxy ⇒ String
Default Proxy address:port from ENV
72 73 74 |
# File 'lib/dnsimple/default.rb', line 72 def proxy ENV['DNSIMPLE_PROXY'] end |
.user_agent ⇒ String
Default User-Agent header string from ENV
66 67 68 |
# File 'lib/dnsimple/default.rb', line 66 def user_agent ENV['DNSIMPLE_USER_AGENT'] end |
.username ⇒ String
Default DNSimple username for Basic Auth from ENV
42 43 44 |
# File 'lib/dnsimple/default.rb', line 42 def username ENV['DNSIMPLE_USERNAME'] end |