Module: DNSimpler

Defined in:
lib/dnsimpler.rb,
lib/dnsimpler/http.rb,
lib/dnsimpler/version.rb

Defined Under Namespace

Classes: HTTP

Constant Summary collapse

MATTRS =
%w[username token base_uri debug]
VERSION =
"0.0.2"
@@debug =

Debuggin is off by default

false
@@username =

API username

''
@@token =

API token

''
@@base_uri =

URI for the requests. Defaults to api.dnsimple.com/

'https://api.dnsimple.com/'
@@http_proxy =

http proxy info. Should be a hash ‘example.com’, port: 8080, user: ‘bob’, pass: ‘ed’

nil

Class Method Summary collapse

Class Method Details

.http_proxyObject



35
36
37
# File 'lib/dnsimpler.rb', line 35

def self.http_proxy
  @@http_proxy
end

.http_proxy=(opts) ⇒ Object



31
32
33
# File 'lib/dnsimpler.rb', line 31

def self.http_proxy=(opts)
  @@http_proxy = OpenStruct.new(opts)
end

.setup {|_self| ... } ⇒ Object

Allow configuring Dnsimpler with a block

Example:

Dnsimpler.setup do |config|
  config.username = '[email protected]'
  config.token    = '1234'
  ....
end

Yields:

  • (_self)

Yield Parameters:

  • _self (DNSimpler)

    the object that the method was called on



48
49
50
# File 'lib/dnsimpler.rb', line 48

def self.setup
  yield self
end