Class: LicenseFinder::License::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/license_finder/license/template.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_content) ⇒ Template

Returns a new instance of Template.



11
12
13
# File 'lib/license_finder/license/template.rb', line 11

def initialize(raw_content)
  @content = Text.normalize_punctuation(raw_content)
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



9
10
11
# File 'lib/license_finder/license/template.rb', line 9

def content
  @content
end

Class Method Details

.named(name) ⇒ Object



4
5
6
7
# File 'lib/license_finder/license/template.rb', line 4

def self.named(name)
  path = ROOT_PATH.join("data", "licenses", "#{name}.txt")
  new(path.read)
end