From 25ffb3147ae4870cee9bf453e7b208c1c4eb8e0b Mon Sep 17 00:00:00 2001 From: Vitalii Date: Tue, 23 Aug 2016 17:25:00 +0300 Subject: [PATCH] modifiable interface for child object Create child object from JSONConvertibleObject with base overriding methods --- Sources/PerfectLib/JSONConvertible.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/PerfectLib/JSONConvertible.swift b/Sources/PerfectLib/JSONConvertible.swift index b5ebed27..288f03e1 100644 --- a/Sources/PerfectLib/JSONConvertible.swift +++ b/Sources/PerfectLib/JSONConvertible.swift @@ -73,11 +73,11 @@ public protocol JSONConvertible { /// Base for a custom object which can be converted to and from JSON. open class JSONConvertibleObject: JSONConvertible { /// Default initializer. - public init() {} + open init() {} /// Get the JSON keys/value. - public func setJSONValues(_ values:[String:Any]) {} + open func setJSONValues(_ values:[String:Any]) {} /// Set the object properties based on the JSON keys/values. - public func getJSONValues() -> [String:Any] { return [String:Any]() } + open func getJSONValues() -> [String:Any] { return [String:Any]() } /// Encode the object into JSON text public func jsonEncodedString() throws -> String { return try self.getJSONValues().jsonEncodedString()