Class: Licensee::Matchers::Matcher
- Inherits:
-
Object
- Object
- Licensee::Matchers::Matcher
- Includes:
- HashHelper
- Defined in:
- lib/licensee/matchers/matcher.rb
Overview
Base class for matchers that identify a license from a ProjectFile.
Constant Summary collapse
- HASH_METHODS =
i[name confidence].freeze
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #confidence ⇒ Object
-
#initialize(file) ⇒ Matcher
constructor
A new instance of Matcher.
- #match ⇒ Object
- #name ⇒ Object
Methods included from HashHelper
Constructor Details
#initialize(file) ⇒ Matcher
Returns a new instance of Matcher.
13 14 15 |
# File 'lib/licensee/matchers/matcher.rb', line 13 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/licensee/matchers/matcher.rb', line 7 def file @file end |
Instance Method Details
#confidence ⇒ Object
25 26 27 |
# File 'lib/licensee/matchers/matcher.rb', line 25 def confidence raise 'Not implemented' end |
#match ⇒ Object
21 22 23 |
# File 'lib/licensee/matchers/matcher.rb', line 21 def match raise 'Not implemented' end |
#name ⇒ Object
17 18 19 |
# File 'lib/licensee/matchers/matcher.rb', line 17 def name @name ||= self.class.to_s.split('::').last.downcase.to_sym end |