Class: DynDynDong::Afraid

Inherits:
Service
  • Object
show all
Defined in:
lib/dyndyndong/services/afraid.rb

Instance Method Summary collapse

Methods inherited from Service

each, #fetch, inherited, instances, #method_missing, services

Constructor Details

#initialize(*args) ⇒ Afraid

Returns a new instance of Afraid.



25
26
27
# File 'lib/dyndyndong/services/afraid.rb', line 25

def initialize(*args)
  super(*args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DynDynDong::Service

Instance Method Details

#alias_host(domain, hash) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/dyndyndong/services/afraid.rb', line 33

def alias_host(domain, hash)
  begin
    res = Net::HTTP.get(URI.parse("http://freedns.afraid.org/dynamic/update.php?#{hash}"))
  rescue Exception => e
    return "#{e} -- skipping..."
  end
  res
end

#host(domain, hash) ⇒ Object



29
30
31
# File 'lib/dyndyndong/services/afraid.rb', line 29

def host(domain, hash)
  @hosts << [domain, hash]
end