class Licensee::Project::File
Constants
- ENCODING
- ENCODING_OPTIONS
Attributes
content[R]
filename[R]
path[R]
Public Class Methods
new(content, filename = nil)
click to toggle source
# File lib/licensee/project_file.rb, line 13 def initialize(content, filename = nil) @content = content @content.force_encoding(ENCODING) unless @content.valid_encoding? @content.encode!(ENCODING, ENCODING_OPTIONS) end @filename = filename end
Public Instance Methods
confidence()
click to toggle source
Returns the percent confident with the match
# File lib/licensee/project_file.rb, line 27 def confidence matcher && matcher.confidence end
license()
click to toggle source
# File lib/licensee/project_file.rb, line 31 def license matcher && matcher.match end
Also aliased as: match
matcher()
click to toggle source
# File lib/licensee/project_file.rb, line 22 def matcher @matcher ||= possible_matchers.map { |m| m.new(self) }.find(&:match) end