Class: Whois::Record::Part

Inherits:
Struct
  • Object
show all
Defined in:
lib/whois/record/part.rb

Overview

A single Whois::Record fragment. For instance, in case of *thin server*, a Whois::Record can be composed by one or more parts corresponding to all responses returned by the WHOIS servers.

A part is composed by a body and a host.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) {|_self| ... } ⇒ Part

Returns a new instance of Part.

Yields:

  • (_self)

Yield Parameters:



26
27
28
29
30
31
32
33
34
35
# File 'lib/whois/record/part.rb', line 26

def initialize(*args)
  if args.first.is_a? Hash
    initialize_with_hash(args.first)
  elsif args.empty?
    super
  else
    raise ArgumentError
  end
  yield(self) if block_given?
end

Instance Attribute Details

#bodyString

The body containing the WHOIS output.

Returns:

  • (String)

    the current value of body



25
26
27
# File 'lib/whois/record/part.rb', line 25

def body
  @body
end

#hostString

The host which returned the body.

Returns:

  • (String)

    the current value of host



25
26
27
# File 'lib/whois/record/part.rb', line 25

def host
  @host
end