Skip to content

Commit

Permalink
format code, bump version to 1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jlandon committed Feb 13, 2016
1 parent 5f08563 commit c8a6966
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ModelRocket.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ModelRocket"
s.version = "1.2.3"
s.version = "1.2.4"
s.license = "MIT"
s.summary = "An iOS framework for creating JSON-based models. Written in Swift."
s.homepage = "https://github.com/ovenbits/ModelRocket"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.2.3</string>
<string>1.2.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
17 changes: 5 additions & 12 deletions Sources/JSON.swift
Expand Up @@ -299,31 +299,24 @@ extension Dictionary {

extension JSON: RawRepresentable {

enum DataError: ErrorType {
public enum DataError: ErrorType {
case MissingObject
case InvalidObject
}

public init?(rawValue: AnyObject) {
guard NSJSONSerialization.isValidJSONObject(rawValue) else {
return nil
}
guard NSJSONSerialization.isValidJSONObject(rawValue) else { return nil }

self.init(rawValue)
}

public var rawValue: AnyObject {
return self.object ?? NSNull()
return object ?? NSNull()
}

public func rawData(options: NSJSONWritingOptions = []) throws -> NSData {
guard let object = object else {
throw DataError.MissingObject
}

guard NSJSONSerialization.isValidJSONObject(object) else {
throw DataError.InvalidObject
}
guard let object = object else { throw DataError.MissingObject }
guard NSJSONSerialization.isValidJSONObject(object) else { throw DataError.InvalidObject }

return try NSJSONSerialization.dataWithJSONObject(object, options: options)
}
Expand Down

0 comments on commit c8a6966

Please sign in to comment.