Sha256: 08c6f7588ed1863893c5012e00e14838c352d7fc294e78f4f06b58bde5337fe0

Contents?: true

Size: 1.52 KB

Versions: 13

Compression:

Stored size: 1.52 KB

Contents

#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
#++


module Whois
  class Server
    module Adapters

      #
      # = Standard Adapter
      #
      # Provides ability to query standard WHOIS interfaces.
      # A standard WHOIS interface accepts socket requests
      # containing the name of the domain and returns a single response
      # containing the record for given query.
      #
      #   a = Standard.new(:tld, ".it", "whois.nic.it")
      #   a.request("example.it")
      #
      # By default, WHOIS interfaces listen on port 43.
      # This adapter also supports an optional port number.
      #
      #   a = Standard.new(:tld, ".it", "whois.nic.it", :port => 20)
      #   a.request("example.it")"
      #
      # == Options
      #
      # The following options can be supplied to customize the creation
      # of a new instance:
      #
      # * +:port+ - Specifies a port number different than 43
      #
      class Standard < Base

        # Executes a WHOIS query to the WHOIS interface
        # listening at +host+ and appends the response
        # to the client buffer.
        #
        # The standard port of a WHOIS request is 43.
        # You can customize it by passing a +:port+ option.
        #
        # @param  [String] string
        # @return [void]
        #
        def request(string)
          response = query_the_socket(string, host)
          buffer_append response, host
        end

      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
whois-3.4.3 lib/whois/server/adapters/standard.rb
whois-3.4.2 lib/whois/server/adapters/standard.rb
whois-3.4.1 lib/whois/server/adapters/standard.rb
whois-3.4.0 lib/whois/server/adapters/standard.rb
whois-3.3.1 lib/whois/server/adapters/standard.rb
whois-3.3.0 lib/whois/server/adapters/standard.rb
whois-3.2.1 lib/whois/server/adapters/standard.rb
whois-3.2.0 lib/whois/server/adapters/standard.rb
whois-3.1.3 lib/whois/server/adapters/standard.rb
whois-3.1.2 lib/whois/server/adapters/standard.rb
whois-3.1.1 lib/whois/server/adapters/standard.rb
whois-3.1.0 lib/whois/server/adapters/standard.rb
whois-3.0.0 lib/whois/server/adapters/standard.rb