Skip to content

Commit

Permalink
Made methods accessible for external usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkhanAlikhanov committed Jul 30, 2017
1 parent 16cb099 commit a440df4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Response.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ open class Response {


extension Response {
convenience init(_ status: Status, body: String, headers: HeaderDictionary = [:]) {
public convenience init(_ status: Status, body: String, headers: HeaderDictionary = [:]) {
self.init(status, body: body.bytes, headers: headers)
}

class func ok(_ body: String, headers: HeaderDictionary = [:]) -> Self {
open class func ok(_ body: String, headers: HeaderDictionary = [:]) -> Self {
return self.init(.ok, body: body.bytes, headers: headers)
}

class func json(_ object: Any, status: Response.Status = .ok, options: JSONSerialization.WritingOptions = .prettyPrinted) -> Response {
open class func json(_ object: Any, status: Response.Status = .ok, options: JSONSerialization.WritingOptions = .prettyPrinted) -> Response {
var response = Response.ok("Could not serialize into json")
if JSONSerialization.isValidJSONObject(object) {
let data = try! JSONSerialization.data(withJSONObject: object, options: options)
Expand Down

0 comments on commit a440df4

Please sign in to comment.