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.



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

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

Class Method Details

.named(name) ⇒ Object



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

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