[Readme] Update code example for enum API
This commit is contained in:
@@ -26,11 +26,12 @@ let context = Context(dictionary: [
|
|||||||
let template = Template(named: "template.stencil")
|
let template = Template(named: "template.stencil")
|
||||||
let result = template.render(context)
|
let result = template.render(context)
|
||||||
|
|
||||||
if let error = result.error {
|
switch result {
|
||||||
println("There was an error rendering your template (\(error)).")
|
case .Error(let error):
|
||||||
|
println("There was an error rendering your template (\(error)).")
|
||||||
|
case .Success(let string):
|
||||||
|
println("\(string)")
|
||||||
}
|
}
|
||||||
|
|
||||||
println("\(result.string)")
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Philosophy
|
## Philosophy
|
||||||
|
|||||||
Reference in New Issue
Block a user