PageRenderTime 25ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/whois/record/nameserver.rb

http://github.com/weppos/whois
Ruby | 48 lines | 10 code | 8 blank | 30 comment | 0 complexity | aeae0fa0bd85b4aa0af3fbdd94993846 MD5 | raw file
Possible License(s): MIT
  1. #--
  2. # Ruby Whois
  3. #
  4. # An intelligent pure Ruby WHOIS client and parser.
  5. #
  6. # Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
  7. #++
  8. require 'whois/record/super_struct'
  9. module Whois
  10. class Record
  11. # Holds the details of the Name Servers extracted from the WHOIS response.
  12. #
  13. # A name server is composed by the several attributes,
  14. # accessible through corresponding getter / setter methods.
  15. #
  16. # Please note that a response is not required to provide
  17. # all the attributes. When an attribute is not available,
  18. # the corresponding value is set to nil.
  19. #
  20. # @attr [String] name
  21. # @attr [String] ipv4
  22. # @attr [String] ipv6
  23. #
  24. class Nameserver < SuperStruct.new(:name, :ipv4, :ipv6)
  25. # Returns a string representation of this object
  26. # composed by the host +name+.
  27. #
  28. # @example
  29. # Nameserver.new(:name => "ns.example.com").to_s
  30. # # => "ns.example.com"
  31. # Nameserver.new.to_s
  32. # # => ""
  33. #
  34. # @return [String] The string representation.
  35. def to_s
  36. name.to_s
  37. end
  38. end
  39. end
  40. end