42 lines
821 B
Swift
42 lines
821 B
Swift
//
|
|
// Hashtag.swift
|
|
// Pachyderm
|
|
//
|
|
// Created by Shadowfacts on 9/9/18.
|
|
// Copyright © 2018 Shadowfacts. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public class Hashtag: Decodable {
|
|
public let name: String
|
|
public let url: URL
|
|
public let history: [History]?
|
|
|
|
public init(name: String, url: URL) {
|
|
self.name = name
|
|
self.url = url
|
|
self.history = nil
|
|
}
|
|
|
|
private enum CodingKeys: String, CodingKey {
|
|
case name
|
|
case url
|
|
case history
|
|
}
|
|
}
|
|
|
|
extension Hashtag {
|
|
public class History: Decodable {
|
|
public let day: Date
|
|
public let uses: Int
|
|
public let accounts: Int
|
|
|
|
private enum CodingKeys: String, CodingKey {
|
|
case day
|
|
case uses
|
|
case accounts
|
|
}
|
|
}
|
|
}
|