Sha256: 0cec1f71e3b12f6af14d615bbc7628e8b6929bd60b16bb1cb96accd0890f6ca5

Contents?: true

Size: 879 Bytes

Versions: 2

Compression:

Stored size: 879 Bytes

Contents

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


require 'whois/record/scanners/base'


module Whois
  class Record
    module Scanners

      # Scanner for the whois.ati.tn record.
      #
      # @since RELEASE
      class WhoisAtiTn < Base

        self.tokenizers += [
            :skip_empty_line,
            :scan_available,
            :scan_disclaimer,
            :scan_keyvalue,
        ]


        tokenizer :scan_available do
          if @input.skip(/^Domain (.+) not found/)
            @ast["status:available"] = true
          end
        end

        tokenizer :scan_disclaimer do
          if @input.match?(/^All rights reserved/)
            @ast["field:disclaimer"] = _scan_lines_to_array(/(.+)\n/).join("\n")
          end
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whois-2.6.1 lib/whois/record/scanners/whois.ati.tn.rb
whois-2.6.0 lib/whois/record/scanners/whois.ati.tn.rb