Skip to content

Commit

Permalink
modifiable interface for child object
Browse files Browse the repository at this point in the history
Create child object from JSONConvertibleObject with base overriding methods

Former-commit-id: 25ffb31
  • Loading branch information
scorovit authored Aug 23, 2016
1 parent 8d6a51b commit cd7967e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/PerfectLib/JSONConvertible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cd7967e

Please sign in to comment.