         return self.object ?? NSNull()
     }
     
-    public func rawData(options: NSJSONWritingOptions = NSJSONWritingOptions(rawValue: 0)) throws -> NSData {
+    public func rawData(options: NSJSONWritingOptions = []) throws -> NSData {
         guard let object = object else {
-            throw JSONDataError.ObjectMissing
+            throw DataError.MissingObject
         }
         
         guard NSJSONSerialization.isValidJSONObject(object) else {
-            throw JSONDataError.InvalidJSONObject
+            throw DataError.InvalidObject
         }
         
         return try NSJSONSerialization.dataWithJSONObject(object, options: options)


public struct JSON {
    
    private(set) var object: AnyObject?
    
    public init() {
        self.object = nil


extension JSON: RawRepresentable {
    
    enum DataError: ErrorType {
        case MissingObject
        case InvalidObject
    }
    
    public init?(rawValue: AnyObject) {
        guard NSJSONSerialization.isValidJSONObject(rawValue) else {
            return nil
        }
        
        self.init(rawValue)
