Class: Whois::Record::Part
- Inherits:
-
Struct
- Object
- Struct
- Whois::Record::Part
- 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
-
#body ⇒ String
The body containing the WHOIS output.
-
#host ⇒ String
The host which returned the body.
Instance Method Summary collapse
-
#initialize(*args) {|_self| ... } ⇒ Part
constructor
A new instance of Part.
Constructor Details
#initialize(*args) {|_self| ... } ⇒ Part
Returns a new instance of Part.
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
#body ⇒ String
The body containing the WHOIS output.
25 26 27 |
# File 'lib/whois/record/part.rb', line 25 def body @body end |
#host ⇒ String
The host which returned the body.
25 26 27 |
# File 'lib/whois/record/part.rb', line 25 def host @host end |