Class: DLDInternet::OpenSRS::NameServers::Command

Inherits:
Thor::Command
  • Object
show all
Defined in:
lib/dldinternet/opensrs/nameservers/command.rb

Instance Method Summary collapse

Instance Method Details

#get(domain = 'dldinternet.com') ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dldinternet/opensrs/nameservers/command.rb', line 15

def get(domain='dldinternet.com')
  # parse_options
  # @logger.info "get nameservers" if options[:verbose]
  #
  # answer = DLDInternet::OpenSRS::API::NameServers::Get.new(options, @logger).GetNameServers(domain)
  # case @config[:format].to_s
  # when /none|text/
  #   @config[:format] = :awesome
  # end
  # output answer

  command_pre
  @header = ->{ sprintf('%-32s%-14s', 'Name','IP Address') }
  @format = ->(res) { sprintf('%-32s%-14s', res['name'], res['ipaddress'] ) }
  answer = DLDInternet::OpenSRS::API::NameServers::Get.new(options, @logger).GetNameServers(domain)
  command_out(answer)

  0
end