Provide simple API for tags

Closes #6
This commit is contained in:
Kyle Fuller
2014-10-26 18:16:27 +00:00
parent 771236953f
commit 67eca80d61
4 changed files with 50 additions and 0 deletions

View File

@@ -52,6 +52,18 @@ public func renderNodes(nodes:[Node], context:Context) -> Result {
return .Success(result)
}
public class SimpleNode : Node {
let handler:(Context) -> (Result)
public init(handler:((Context) -> (Result))) {
self.handler = handler
}
public func render(context:Context) -> Result {
return handler(context)
}
}
public class TextNode : Node {
public let text:String