Class: Schoolkeep::Template::PartialLoader

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ PartialLoader

Returns a new instance of PartialLoader.



56
57
58
# File 'lib/schoolkeep/template.rb', line 56

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



55
56
57
# File 'lib/schoolkeep/template.rb', line 55

def path
  @path
end

Instance Method Details

#load(name) ⇒ Object



60
61
62
63
64
# File 'lib/schoolkeep/template.rb', line 60

def load(name)
  name = "_#{name}.html.sktl"
  partial_path = File.join(path, name)
  ::Scribble::Partial.new File.read(partial_path)
end