Class: Schoolkeep::Template::PartialLoader
- Inherits:
-
Object
- Object
- Schoolkeep::Template::PartialLoader
- Defined in:
- lib/schoolkeep/template.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ PartialLoader
constructor
A new instance of PartialLoader.
- #load(name) ⇒ Object
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
#path ⇒ Object (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 |