Class: Slippers::FileTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/engine/file_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Template

#eql?, #hash

Constructor Details

#initialize(filename) ⇒ FileTemplate

Returns a new instance of FileTemplate.



3
4
5
# File 'lib/engine/file_template.rb', line 3

def initialize(filename)
  @filename = filename
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



6
7
8
# File 'lib/engine/file_template.rb', line 6

def filename
  @filename
end

Instance Method Details

#templateObject



7
8
9
10
# File 'lib/engine/file_template.rb', line 7

def template()
  return @template if @template
  @template = File.read(@filename)
end