Class: Licensee::Matchers::Matcher

Inherits:
Object
  • Object
show all
Includes:
HashHelper
Defined in:
lib/licensee/matchers/matcher.rb

Overview

Base class for matchers that identify a license from a ProjectFile.

Direct Known Subclasses

Copyright, Dice, Exact, Package, Reference

Constant Summary collapse

HASH_METHODS =
i[name confidence].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashHelper

#serialize_hash_value, #to_h

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

#fileObject (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

#confidenceObject



25
26
27
# File 'lib/licensee/matchers/matcher.rb', line 25

def confidence
  raise 'Not implemented'
end

#matchObject



21
22
23
# File 'lib/licensee/matchers/matcher.rb', line 21

def match
  raise 'Not implemented'
end

#nameObject



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

def name
  @name ||= self.class.to_s.split('::').last.downcase.to_sym
end