Skip to content

Commit

Permalink
Update APIHelper.mustache
Browse files Browse the repository at this point in the history
  • Loading branch information
JMDHo committed Apr 20, 2016
1 parent 56ac576 commit 3cdc1b3
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ class APIHelper {
}
}

if destination.isEmpty {
return nil
}
return destination
}
static func convertBoolToString(source: [String: AnyObject]) -> [String:AnyObject]? {
var destination = [String:AnyObject]()
let theTrue = NSNumber(bool: true)
let theFalse = NSNumber(bool: false)
for (key, value) in source {
switch value {
case let x where x === theTrue || x === theFalse:
destination[key] = "\(value as! Bool)"
default:
destination[key] = "not a bool"
}
}

if destination.isEmpty {
return nil
}
Expand Down

0 comments on commit 3cdc1b3

Please sign in to comment.