Class: LicenseFinder::License::Template
- Inherits:
-
Object
- Object
- LicenseFinder::License::Template
- Defined in:
- lib/license_finder/license/template.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw_content) ⇒ Template
constructor
A new instance of Template.
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
#content ⇒ Object (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 |