HBEnvironment

public struct HBEnvironment : Decodable, ExpressibleByDictionaryLiteral

Access environment variables

  • Undocumented

    Declaration

    Swift

    public static let shared: HBEnvironment
  • initialize from environment variables

    Declaration

    Swift

    public init()
  • initialize from dictionary

    Declaration

    Swift

    public init(values: [String : String])
  • initialize from dictionary literal

    Declaration

    Swift

    public init(dictionaryLiteral elements: (String, String)...)
  • Initialize from Decodable

    Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Get environment variable with name

    Declaration

    Swift

    public func get(_ s: String) -> String?

    Parameters

    s

    Environment variable name

  • Get environment variable with name as a certain type

    Declaration

    Swift

    public func get<T>(_ s: String, as: T.Type) -> T? where T : LosslessStringConvertible

    Parameters

    s

    Environment variable name

    as

    Type we want variable to be cast to

  • Set environment variable

    Declaration

    Swift

    public mutating func set(_ s: String, value: String?)

    Parameters

    s

    Environment variable name

    value

    Environment variable name value