Sha256: 25e5daa025baa49c4aed1570f1a4fab8822e80d78c19e700c92413bf0c97dd1c
Contents?: true
Size: 788 Bytes
Versions: 16
Compression:
Stored size: 788 Bytes
Contents
package aws import ( "fmt" ) // Ternary is an enum allowing an unknown or none state in addition to a bool's // true and false. type Ternary int func (t Ternary) String() string { switch t { case UnknownTernary: return "unknown" case FalseTernary: return "false" case TrueTernary: return "true" default: return fmt.Sprintf("unknown value, %d", int(t)) } } // Bool returns true if the value is TrueTernary, false otherwise. func (t Ternary) Bool() bool { return t == TrueTernary } // Enumerations for the values of the Ternary type. const ( UnknownTernary Ternary = iota FalseTernary TrueTernary ) // BoolTernary returns a true or false Ternary value for the bool provided. func BoolTernary(v bool) Ternary { if v { return TrueTernary } return FalseTernary }
Version data entries
16 entries across 16 versions & 1 rubygems