Sha256: 59b124ebb92c23a9a686b800b16470e47833320f145e969296e743d09eb3d368

Contents?: true

Size: 811 Bytes

Versions: 2

Compression:

Stored size: 811 Bytes

Contents

#
# = Ruby Whois
#
# An intelligent pure Ruby WHOIS client.
#
#
# Category::    Net
# Package::     Whois
# Author::      Simone Carletti <weppos@weppos.net>
# License::     MIT License
#
#--
#
#++


require 'socket'
require 'timeout'


module Whois

  class Client

    # The maximum time to run a whois query expressed in seconds
    DEFAULT_TIMEOUT = 5

    attr_accessor :timeout


    def initialize(options = {})
      self.timeout = options[:timeout] || DEFAULT_TIMEOUT
    end


    class Query # :nodoc
      # IPv6?
      # RPSL?
      # email?
      # NSIC?
      # ASP32?
      # IP?
      # domain?
      # network?
    end
    
    
    def query(qstring)
      Timeout::timeout(timeout) do
        @server = Server.guess(qstring)
        @server.query(qstring)
      end
    end
      
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whois-0.5.0 lib/whois/client.rb
whois-0.5.1 lib/whois/client.rb