Skip to content

Instantly share code, notes, and snippets.

@douglastaquary
Created November 16, 2017 22:13
Show Gist options
  • Save douglastaquary/f255279c511aa4b499354028ad39fe29 to your computer and use it in GitHub Desktop.
Save douglastaquary/f255279c511aa4b499354028ad39fe29 to your computer and use it in GitHub Desktop.
import Foundation
public enum Tamanho: String {
case individual = "INDIVIDUAL"
case pequeno = "PEQUENO"
case medio = "MEDIO"
case grande = "GRANDE"
case gigante = "GIGANTE"
case unico = "UNICO"
static func build(rawValue:String) -> Tamanho {
return Tamanho(rawValue: rawValue) ?? .unico
}
init(fromRawValue: String) {
self = Tamanho(rawValue: fromRawValue) ?? .unico
}
}
import Foundation
public enum Tipo: String {
case grupo = "GRUPO"
case mutiplaEscolha = "MULTIPLA_ESCOLHA"
static func build(rawValue:String) -> Tipo {
return Tipo(rawValue: rawValue) ?? .mutiplaEscolha
}
init(fromRawValue: String) {
self = Tipo(rawValue: fromRawValue) ?? .mutiplaEscolha
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment