Skip to content

Commit

Permalink
add StructuredDataFallibleRepresentable (#48)
Browse files Browse the repository at this point in the history
* update to snapshot 06-20

* add StructuredDataFallibleRepresentable
  • Loading branch information
paulofaria authored Jul 5, 2016
1 parent 155fc50 commit 6660400
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Sources/StructuredData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ public protocol StructuredDataInitializable {
init(structuredData: StructuredData) throws
}

public protocol StructuredDataRepresentable {
public protocol StructuredDataRepresentable: StructuredDataFallibleRepresentable {
var structuredData: StructuredData { get }
}

public protocol StructuredDataFallibleRepresentable {
func asStructuredData() throws -> StructuredData
}

extension StructuredDataRepresentable {
public func asStructuredData() throws -> StructuredData {
return structuredData
}
}

public protocol StructuredDataConvertible: StructuredDataInitializable, StructuredDataRepresentable {}

public enum StructuredData {
Expand Down

0 comments on commit 6660400

Please # to comment.