Sha256: f8e4f92b2f8cc5a9cfe1d705f4bad5d8f19855dca217951bc28a9e796a0ca9a1
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
#-- # Ruby Whois # # An intelligent pure Ruby WHOIS client and parser. # # Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net> #++ module Whois class Record # 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+. # # @attr [String] body The body containing the WHOIS output. # @attr [String] host The host which returned the body. # class Part < Struct.new(:body, :host) def initialize(*args) if args.first.is_a? Hash initialize_with_hash(args.first) elsif args.size == 0 super else raise ArgumentError end yield(self) if block_given? end private def initialize_with_hash(attributes = {}) attributes.each do |key, value| self[key] = value end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
whois-4.0.0.pre.beta2 | lib/whois/record/part.rb |
whois-4.0.0.pre.beta1 | lib/whois/record/part.rb |