MarcoEidinger / npsapi-swift

@@ -66,13 +66,13 @@
Loading
66 66
    /// Nevada
67 67
    case nevada = "NV"
68 68
    /// New Hampshire
69 -
    case newhampshire = "NH"
69 +
    case newHampshire = "NH"
70 70
    /// New Jersey
71 -
    case newjersey = "NJ"
71 +
    case newJersey = "NJ"
72 72
    /// New Mexcio
73 -
    case newmexico = "NM"
73 +
    case newMexico = "NM"
74 74
    /// New York
75 -
    case newyork = "NY"
75 +
    case newYork = "NY"
76 76
    /// North Carolina
77 77
    case northCarolina = "NC"
78 78
    /// North Dakota
@@ -113,8 +113,17 @@
Loading
113 113
    /// Returns name of the state, e.g. "California" for .california
114 114
    public var name: String {
115 115
        let caseName = String(describing: self)
116 -
        let capitlizedCaseName = caseName.prefix(1).capitalized + caseName.dropFirst()
117 -
        return capitlizedCaseName
116 +
        var caseNameMissingFirstCharacter: String = String(caseName.dropFirst())
117 +
118 +
        for character in caseNameMissingFirstCharacter where character.isUppercase {
119 +
            if let insertIndex = caseNameMissingFirstCharacter.firstIndex(of: character) {
120 +
                caseNameMissingFirstCharacter.insert(" ", at: insertIndex)
121 +
            }
122 +
        }
123 +
124 +
        let capitalizedCaseName = caseName.prefix(1).capitalized + caseNameMissingFirstCharacter
125 +
126 +
        return capitalizedCaseName
118 127
    }
119 128
120 129
    /// Returns 2 character state code, e.g. "CA" for .california

@@ -21,16 +21,6 @@
Loading
21 21
/// Park basics data includes location, contact, operating hours, and entrance fee/pass information for each national park. At least five photos of each park are also available.
22 22
public struct Park: Decodable, Identifiable, Hashable {
23 23
24 -
    /// Park can be compared for equality using the equal-to operator (`==`) or inequality using the not-equal-to operator (`!=`)
25 -
    public static func == (lhs: Park, rhs: Park) -> Bool {
26 -
        return lhs.id == rhs.id
27 -
    }
28 -
29 -
    /// Park conforms to the Hashable protocol and hence can be used in a set or as a dictionary key
30 -
    public func hash(into hasher: inout Hasher) {
31 -
        hasher.combine(self.id)
32 -
    }
33 -
34 24
    enum CodingKeys: CodingKey {
35 25
        case id, parkCode, name, fullName, description, url, designation, states, latLong, directionsInfo, directionsUrl, weatherInfo, images, entranceFees, entrancePasses
36 26
    }
@@ -84,6 +74,16 @@
Loading
84 74
        self.entranceFees = entranceFees
85 75
        self.entrancePasses = entrancePasses
86 76
    }
77 +
78 +
    /// Park can be compared for equality using the equal-to operator (`==`) or inequality using the not-equal-to operator (`!=`)
79 +
    public static func == (lhs: Park, rhs: Park) -> Bool {
80 +
        return lhs.id == rhs.id
81 +
    }
82 +
83 +
    /// Park conforms to the Hashable protocol and hence can be used in a set or as a dictionary key
84 +
    public func hash(into hasher: inout Hasher) {
85 +
        hasher.combine(self.id)
86 +
    }
87 87
}
88 88
89 89
extension Park {
Files Coverage
Sources/NatParkSwiftKit 95.62%
Project Totals (12 files) 95.62%
75.1
default=
TRAVIS_OS_NAME=osx

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading