Sha256: c2184b2ef6be808cb5e24db87208cf359c30e7bd8f27aff11ba733ef21e50952

Contents?: true

Size: 991 Bytes

Versions: 1

Compression:

Stored size: 991 Bytes

Contents

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


require 'whois/record/scanners/base'


module Whois
  class Record
    module Scanners

      # Scanner for the Icann Compliant-based records.
      class BaseIcannCompliant < Base

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

        tokenizer :scan_available do
          if settings[:pattern_available] && @input.skip_until(settings[:pattern_available])
            @ast['status:available'] = true
          end
        end

        tokenizer :skip_head do
          if @input.skip_until(/^Domain Name:/)
            @input.scan(/\s(.+)\n/)
            @ast["Domain Name"] = @input[1].strip
          end
        end

        tokenizer :skip_end do
          @input.terminate
        end

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whois-3.4.0 lib/whois/record/scanners/base_icann_compliant.rb