-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from uphold/feature/add-transaction-node
Add Node model to transaction origin and destination
- Loading branch information
Showing
6 changed files
with
97 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import Foundation | ||
import ObjectMapper | ||
|
||
/// Node model. | ||
open class Node: Mappable { | ||
|
||
/// The brand. | ||
public private(set) final var brand: String? | ||
|
||
/// The id. | ||
public private(set) final var id: String? | ||
|
||
/// The type. | ||
public private(set) final var type: String? | ||
|
||
/** | ||
Constructor. | ||
|
||
- parameter brand: The brand. | ||
- parameter id: The id. | ||
- parameter type: The type. | ||
*/ | ||
public init(brand: String, id: String, type: String) { | ||
self.brand = brand | ||
self.id = type | ||
self.type = type | ||
} | ||
|
||
// MARK: Required by the ObjectMapper. | ||
|
||
/** | ||
Constructor. | ||
|
||
- parameter map: Mapping data object. | ||
*/ | ||
required public init?(map: Map) { | ||
} | ||
|
||
/** | ||
Maps the JSON to the Object. | ||
|
||
- parameter map: The object to map. | ||
*/ | ||
open func mapping(map: Map) { | ||
brand <- map["brand"] | ||
id <- map["id"] | ||
type <- map["type"] | ||
} | ||
|
||
} |
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
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