This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// EncoderType.swift | ||
// Alexander | ||
// | ||
// Created by Caleb Davenport on 11/19/15. | ||
// Copyright © 2015 Hodinkee. All rights reserved. | ||
// | ||
|
||
public protocol EncoderType { | ||
typealias Value | ||
static func encode(value: Value) -> JSON | ||
} | ||
|
||
public struct NSDateTimeIntervalSince1970Encoder: EncoderType { | ||
public typealias Value = NSDate | ||
public static func encode(value: NSDate) -> JSON { | ||
return JSON(object: value.timeIntervalSince1970) | ||
} | ||
} | ||
|
||
public struct NSDateTimeIntervalSinceReferenceDateEncoder: EncoderType { | ||
public typealias Value = NSDate | ||
public static func encode(value: NSDate) -> JSON { | ||
return JSON(object: value.timeIntervalSinceReferenceDate) | ||
} | ||
} | ||
|
||
public struct NSURLEncoder: EncoderType { | ||
public typealias Value = NSURL | ||
public static func encode(value: NSURL) -> JSON { | ||
return JSON(object: value.absoluteString) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.