Class: Licensee::Matchers::Exact

Inherits:
Matcher
  • Object
show all
Defined in:
lib/licensee/matchers/exact.rb

Constant Summary

Constants inherited from Matcher

Matcher::HASH_METHODS

Instance Attribute Summary

Attributes inherited from Matcher

#file

Instance Method Summary collapse

Methods inherited from Matcher

#initialize, #name

Methods included from HashHelper

#to_h

Constructor Details

This class inherits a constructor from Licensee::Matchers::Matcher

Instance Method Details

#confidenceObject



11
12
13
# File 'lib/licensee/matchers/exact.rb', line 11

def confidence
  100
end

#matchObject



4
5
6
7
8
9
# File 'lib/licensee/matchers/exact.rb', line 4

def match
  return @match if defined? @match
  @match = Licensee.licenses(hidden: true).find do |license|
    license.length == @file.length && license.wordset == @file.wordset
  end
end