Class: LicenseFinder::License::Template

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

Constant Summary collapse

TEMPLATE_PATH =
ROOT_PATH.join('license', 'templates')

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_content) ⇒ Template

Returns a new instance of Template.



14
15
16
# File 'lib/license_finder/license/template.rb', line 14

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

Class Method Details

.named(name) ⇒ Object



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

def self.named(name)
  new TEMPLATE_PATH.join("#{name}.txt").read
end