Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Prefer private to fileprivate
Browse files Browse the repository at this point in the history
  • Loading branch information
pvzig committed Dec 30, 2016
1 parent f50107f commit b877fac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions SlackKit/Sources/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public class SlackClient {
}
}

fileprivate func addSentMessage(_ dictionary: [String: Any]) {
private func addSentMessage(_ dictionary: [String: Any]) {
var message = dictionary
guard let id = message["id"] as? NSNumber else {
return
Expand All @@ -143,7 +143,7 @@ public class SlackClient {
}

//MARK: - Client setup
fileprivate func initialSetup(JSON: [String: Any]) {
private func initialSetup(JSON: [String: Any]) {
team = Team(team: JSON["team"] as? [String: Any])
authenticatedUser = User(user: JSON["self"] as? [String: Any])
authenticatedUser?.doNotDisturbStatus = DoNotDisturbStatus(status: JSON["dnd"] as? [String: Any])
Expand All @@ -156,28 +156,28 @@ public class SlackClient {
enumerateSubteams(JSON["subteams"] as? [String: Any])
}

fileprivate func addUser(_ aUser: [String: Any]) {
private func addUser(_ aUser: [String: Any]) {
let user = User(user: aUser)
if let id = user.id {
users[id] = user
}
}

fileprivate func addChannel(_ aChannel: [String: Any]) {
private func addChannel(_ aChannel: [String: Any]) {
let channel = Channel(channel: aChannel)
if let id = channel.id {
channels[id] = channel
}
}

fileprivate func addBot(_ aBot: [String: Any]) {
private func addBot(_ aBot: [String: Any]) {
let bot = Bot(bot: aBot)
if let id = bot.id {
bots[id] = bot
}
}

fileprivate func enumerateSubteams(_ subteams: [String: Any]?) {
private func enumerateSubteams(_ subteams: [String: Any]?) {
if let subteams = subteams {
if let all = subteams["all"] as? [[String: Any]] {
for item in all {
Expand All @@ -197,7 +197,7 @@ public class SlackClient {
}

// MARK: - Utilities
fileprivate func enumerateObjects(_ array: [Any]?, initalizer: ([String: Any])-> Void) {
private func enumerateObjects(_ array: [Any]?, initalizer: ([String: Any])-> Void) {
if let array = array {
for object in array {
if let dictionary = object as? [String: Any] {
Expand Down
8 changes: 4 additions & 4 deletions SlackKit/Sources/SlackWebAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public class SlackWebAPI {
case im = "im"
}

fileprivate let networkInterface: NetworkInterface
fileprivate let token: String
private let networkInterface: NetworkInterface
private let token: String

public init(token: String) {
self.networkInterface = NetworkInterface()
Expand Down Expand Up @@ -658,7 +658,7 @@ public class SlackWebAPI {
}

//MARK: - Encode Attachments
fileprivate func encodeAttachments(_ attachments: [Attachment?]?) -> String? {
private func encodeAttachments(_ attachments: [Attachment?]?) -> String? {
if let attachments = attachments {
var attachmentArray: [[String: Any]] = []
for attachment in attachments {
Expand Down Expand Up @@ -688,7 +688,7 @@ public class SlackWebAPI {
}

//MARK: - Enumerate Do Not Disturb Status
fileprivate func enumerateDNDStatuses(_ statuses: [String: Any]) -> [String: DoNotDisturbStatus] {
private func enumerateDNDStatuses(_ statuses: [String: Any]) -> [String: DoNotDisturbStatus] {
var retVal = [String: DoNotDisturbStatus]()
for key in statuses.keys {
retVal[key] = DoNotDisturbStatus(status: statuses[key] as? [String: Any])
Expand Down

0 comments on commit b877fac

Please sign in to comment.