Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Commit

Permalink
The Great API Renaming.
Browse files Browse the repository at this point in the history
Renaming and reworking of all externally faceing APIs and some internally facing
APIs to match the API guidlines. See issue #96 for full details on the
exact changes.

Resolves #96
  • Loading branch information
rhyshort committed Jul 28, 2016
1 parent f450390 commit 6432acb
Show file tree
Hide file tree
Showing 37 changed files with 1,115 additions and 1,505 deletions.
2 changes: 1 addition & 1 deletion Source/CouchDatabaseOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ public protocol CouchDatabaseOperation: CouchOperation {
/**
The name of the database that the operation will be operating on.
*/
// var databaseName: String { get set } //FIXME bring back once all the conversions are done.
var databaseName: String { get }
}
11 changes: 6 additions & 5 deletions Source/CreateDatabaseOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ import Foundation
/**
An operation to create a database in a CouchDB instance.
*/
public class CreateDatabaseOperation: CouchOperation, JsonOperation {
public class CreateDatabaseOperation: CouchOperation, JSONOperation {

/**
Creates the operation.
- parameter name: The name of the database this operation will create.
- parameter completionHandler: optional handler to call when the operation completes.
*/
public init(name: String) {
public init(name: String, completionHandler: ((response: [String : AnyObject]?, httpInfo: HTTPInfo?, error: ErrorProtocol?) -> Void)? = nil) {
self.name = name
self.completionHandler = completionHandler
}

public var completionHandler: ((response: [String : AnyObject]?, httpInfo: HTTPInfo?, error: ErrorProtocol?) -> Void)?
public let completionHandler: ((response: [String : AnyObject]?, httpInfo: HTTPInfo?, error: ErrorProtocol?) -> Void)?

/**
The name of the database to create.
*/
public var name: String
public let name: String

public var method: String {
get {
Expand All @@ -45,7 +47,6 @@ public class CreateDatabaseOperation: CouchOperation, JsonOperation {

public var endpoint: String {
get {
// Safe to force unwrap, validation would fail if this is nil
return "/\(self.name)"
}
}
Expand Down
Loading

0 comments on commit 6432acb

Please sign in to comment.