Class: CZDS::CLI::Main

Inherits:
Thor
  • Object
show all
Defined in:
lib/czds/cli/main.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tldObject (readonly)

Returns the value of attribute tld.



7
8
9
# File 'lib/czds/cli/main.rb', line 7

def tld
  @tld
end

Instance Method Details

#downloadObject



17
18
19
20
21
22
23
24
25
# File 'lib/czds/cli/main.rb', line 17

def download
  config_file = load_config(options[:config_file])
  configure_client(options, config_file)

  tld = options[:tld] || config_file['tld'] || CZDS::Configuration::DEFAULTS[:tld]

  zone_file = CZDS::ZoneFile.new(tld)
  zone_file.download
end

#statusObject



34
35
36
37
38
39
40
41
42
# File 'lib/czds/cli/main.rb', line 34

def status
  config_file = load_config(options[:config_file])
  configure_client(options, config_file)

  tld = options[:tld] || config_file['tld'] || CZDS::Configuration::DEFAULTS[:tld]

  zone_file = CZDS::ZoneFile.new(tld)
  puts zone_file.status.to_h
end