Module: Domrobot

Defined in:
lib/domrobot.rb,
lib/domrobot/cli.rb,
lib/domrobot/config.rb,
lib/domrobot/address.rb,
lib/domrobot/version.rb,
lib/domrobot/subdomain.rb,
lib/domrobot/types/record.rb,
lib/domrobot/sections/nameserver.rb

Defined Under Namespace

Modules: Address, Sections, Subdomain Classes: Cli, Config, Record

Constant Summary collapse

CONFIG_FILE =
"/etc/domrobot.tml"
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.loginObject



15
16
17
18
19
# File 'lib/domrobot.rb', line 15

def 
  return @login if @login
  result = robot.(Config.general.username,Config.general.password)
  @login = result["code"] == 1000
end

.nameserverObject



24
25
26
# File 'lib/domrobot.rb', line 24

def nameserver
  Domrobot::Sections::Nameserver
end

.robotObject



12
13
14
# File 'lib/domrobot.rb', line 12

def robot
  @robot ||= INWX::Domrobot.new(Config.general.server)
end

.run(object, method, params) ⇒ Object



20
21
22
23
# File 'lib/domrobot.rb', line 20

def run object, method, params
  params = params.map{|k,v|["#{k}",v]}.to_h
  robot.call(object.to_s, method.to_s, params)
end