Sha256: 4f19cebd08293e71db9e5a0889dc4ede4854db030e023bf795687e0f15d66b87

Contents?: true

Size: 404 Bytes

Versions: 5

Compression:

Stored size: 404 Bytes

Contents

# encoding: utf-8

module Ryodo
  class Parser

    def initialize
      @rules = Ryodo::RuleSet.new
    end

    def build_query domain
      domain.split(".").reverse
    end

    def parse domain
      @rules.match build_query(domain)
    end

    class << self

      def run domain
        instance.parse domain
      end


      def instance
        @@instance ||= new
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ryodo-0.2.2 lib/ryodo/parser.rb
ryodo-0.2.0 lib/ryodo/parser.rb
ryodo-0.1.0.1 lib/ryodo/parser.rb
ryodo-0.1.0 lib/ryodo/parser.rb
ryodo-0.0.3 lib/ryodo/parser.rb