class Ryodo::Parser

Public Class Methods

instance() click to toggle source
# File lib/ryodo/parser.rb, line 20
def instance
  @instance ||= new
end
new() click to toggle source
# File lib/ryodo/parser.rb, line 3
def initialize
  @rules = Ryodo::RuleSet.new
end
run(domain) click to toggle source
# File lib/ryodo/parser.rb, line 16
def run(domain)
  instance.parse(domain)
end

Public Instance Methods

build_query(domain) click to toggle source
# File lib/ryodo/parser.rb, line 7
def build_query(domain)
  domain.split(".").reverse
end
parse(domain) click to toggle source
# File lib/ryodo/parser.rb, line 11
def parse(domain)
  @rules.match build_query(domain)
end