feat: New extensions API (#78)

This commit is contained in:
Kyle Fuller
2016-12-07 21:27:31 +00:00
committed by GitHub
parent d3706f074d
commit d7b152089e
15 changed files with 128 additions and 287 deletions

View File

@@ -3,16 +3,14 @@ public class Context {
var dictionaries: [[String: Any?]]
public let environment: Environment
let namespace: Namespace
init(dictionary: [String: Any]? = nil, namespace: Namespace? = nil, environment: Environment? = nil) {
init(dictionary: [String: Any]? = nil, environment: Environment? = nil) {
if let dictionary = dictionary {
dictionaries = [dictionary]
} else {
dictionaries = []
}
self.namespace = namespace ?? environment?.namespace ?? Namespace()
self.environment = environment ?? Environment()
}