Module: Dnsmadeeasy_verify

Defined in:
lib/dnsmadeeasy_verify.rb,
lib/dnsmadeeasy_verify/domain.rb,
lib/dnsmadeeasy_verify/version.rb,
lib/dnsmadeeasy_verify/dnsmadeeasy_api.rb

Defined Under Namespace

Classes: Configuration, Domain

Constant Summary collapse

VERSION =
"0.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



38
39
40
# File 'lib/dnsmadeeasy_verify.rb', line 38

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



45
46
47
48
# File 'lib/dnsmadeeasy_verify.rb', line 45

def self.configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

.domains_not_on_dnsmadeeasyObject

Returns all domains that are not correctly setup on DNS Made Easy



28
29
30
31
32
33
34
35
# File 'lib/dnsmadeeasy_verify.rb', line 28

def self.domains_not_on_dnsmadeeasy()
  domains = self.list_domains
  domains_not_on_dnsmadeeasy = Hash.new
  domains.each do |k, v|
    domains_not_on_dnsmadeeasy[k] = v unless v.do_name_servers_contain("dnsmadeeasy.com")
  end
  domains_not_on_dnsmadeeasy
end

.list_domainsObject

Returns all domains from DNS Made Easy



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/dnsmadeeasy_verify.rb', line 11

def self.list_domains
  domains = Hash.new
  response = get_all_domains(Dnsmadeeasy_verify.configuration.dnsmadeeasy_api_key, Dnsmadeeasy_verify.configuration.dnsmadeeasy_api_secret)
  case response.status
    when 200
      data = JSON.parse(response.body)

      data['data'].each do |child|
          domains[child["name"]] = Domain.new(child["name"])
      end

  end

  domains
end