Sha256: 4d0aeab5a84bfe3a377b3a03a4be93539041a073a8835d0478ff8549d9d36f73
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true #-- # Ruby Whois # # An intelligent pure Ruby WHOIS client and parser. # # Copyright (c) 2009-2021 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. # Part = Struct.new(:body, :host) do 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
whois-5.0.2 | lib/whois/record/part.rb |