Skip to content

Commit

Permalink
Merge pull request #37 from NicholasBellucci/feature/enum-raw-value-r…
Browse files Browse the repository at this point in the history
…epresentable

EnumRawValueRepresentable
  • Loading branch information
NicholasBellucci authored Sep 8, 2020
2 parents e645534 + a23ec47 commit aba08d2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/SociableWeaver/Protocols/Argument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ import Foundation
*/
typealias Argument = (key: String, value: ArgumentValueRepresentable)

public protocol EnumValueRepresentable: ArgumentValueRepresentable, RawRepresentable { }
public protocol EnumValueRepresentable: ArgumentValueRepresentable { }
public protocol EnumRawValueRepresentable: ArgumentValueRepresentable, RawRepresentable { }

public extension EnumValueRepresentable {
var argumentValue: String {
"\(self)".uppercased()
}
}

public extension EnumRawValueRepresentable {
var argumentValue: String {
"\(self.rawValue)".uppercased()
}
Expand Down

0 comments on commit aba08d2

Please sign in to comment.