Moving stuff about, renaming

This commit is contained in:
Adam Fowler
2021-03-12 09:55:12 +00:00
parent 02af0ec296
commit 633f494e18
5 changed files with 59 additions and 55 deletions

View File

@@ -8,10 +8,14 @@ public class HBMustacheLibrary {
templates[name] = template
}
public func getTemplate(named name: String) -> HBMustacheTemplate? {
templates[name]
}
public func render(_ object: Any, withTemplateNamed name: String) -> String? {
guard let template = templates[name] else { return nil }
return template.render(object, library: self)
}
var templates: [String: HBMustacheTemplate]
private var templates: [String: HBMustacheTemplate]
}