Sha256: f62a970e27a5a29c779b875eefe7c77fe5dd5f138d06b98fe24f9cb5f7c8422c
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-2022 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.zero? 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.1.0 | lib/whois/record/part.rb |