Class: Licensee::Matchers::Exact
- Inherits:
-
Object
- Object
- Licensee::Matchers::Exact
- Defined in:
- lib/licensee/matchers/exact_matcher.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #confidence ⇒ Object
-
#initialize(file) ⇒ Exact
constructor
A new instance of Exact.
- #match ⇒ Object
Constructor Details
#initialize(file) ⇒ Exact
Returns a new instance of Exact.
6 7 8 |
# File 'lib/licensee/matchers/exact_matcher.rb', line 6 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
4 5 6 |
# File 'lib/licensee/matchers/exact_matcher.rb', line 4 def file @file end |
Instance Method Details
#confidence ⇒ Object
16 17 18 |
# File 'lib/licensee/matchers/exact_matcher.rb', line 16 def confidence 100 end |
#match ⇒ Object
10 11 12 13 14 |
# File 'lib/licensee/matchers/exact_matcher.rb', line 10 def match Licensee.licenses(hidden: true).find do |license| license.length == @file.length && license.wordset == @file.wordset end end |