Sha256: 9bdcad79279c3b44bd8ff60d2acbce64ccfb8a45a4b5133e713b49a27dfffa14

Contents?: true

Size: 1011 Bytes

Versions: 9

Compression:

Stored size: 1011 Bytes

Contents

require_relative 'base'

module Whois
  module Scanners

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

      self.tokenizers += [
          :skip_head,
          :scan_available,
          :scan_throttled,
          :skip_empty_line,
          :skip_blank_line,
          :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 :scan_throttled do
        if settings[:pattern_throttled] && @input.skip_until(settings[:pattern_throttled])
          @ast['response:throttled'] = 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

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
whois-parser-2.0.0 lib/whois/scanners/base_icann_compliant.rb
whois-parser-1.2.0 lib/whois/scanners/base_icann_compliant.rb
whois-parser-1.1.0 lib/whois/scanners/base_icann_compliant.rb
whois-parser-1.0.1 lib/whois/scanners/base_icann_compliant.rb
hetzner-whois-parser-1.0.1.rc2 lib/whois/scanners/base_icann_compliant.rb
hetzner-whois-parser-1.0.1.rc1 lib/whois/scanners/base_icann_compliant.rb
whois-parser-1.0.0 lib/whois/scanners/base_icann_compliant.rb
whois-parser-1.0.0.pre.beta2 lib/whois/scanners/base_icann_compliant.rb
whois-parser-1.0.0.pre.beta1 lib/whois/scanners/base_icann_compliant.rb