Class: Licensee::Matchers::Exact

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Exact

Returns a new instance of Exact.



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

def initialize(file)
  @file = file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



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

def file
  @file
end

Instance Method Details

#confidenceObject



17
18
19
# File 'lib/licensee/matchers/exact.rb', line 17

def confidence
  100
end

#matchObject



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

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