module Plagiarism::Strategy

Public Instance Methods

get(name = :yahoo) click to toggle source
# File lib/plagiarism/strategy.rb, line 11
def get(name = :yahoo)
  Strategies.const_get(name.to_s.split('_').map(&:capitalize).join(''))
end
match(content, params) click to toggle source
# File lib/plagiarism/strategy.rb, line 22
def match(content, params)
  Config.strategies.find do |strategy|
    klass = get(strategy)
    link = klass.new(content, params).match
    link and return (link == true ? '' : link)
  end
end
unique?(content, params) click to toggle source
# File lib/plagiarism/strategy.rb, line 15
def unique?(content, params)
  Config.strategies.all? do |strategy|
    klass = get(strategy)
    klass.new(content, params).unique?
  end
end