Class: PostfinancecheckoutRubySdk::UserType

Inherits:
Object
  • Object
show all
Defined in:
lib/postfinancecheckout-ruby-sdk/models/user_type.rb

Constant Summary collapse

HUMAN_USER =
"HUMAN_USER".freeze
SINGLE_SIGNON_USER =
"SINGLE_SIGNON_USER".freeze
APPLICATION_USER =
"APPLICATION_USER".freeze
ANONYMOUS_USER =
"ANONYMOUS_USER".freeze
SERVER_USER =
"SERVER_USER".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



32
33
34
# File 'lib/postfinancecheckout-ruby-sdk/models/user_type.rb', line 32

def self.all_vars
  @all_vars ||= [HUMAN_USER, SINGLE_SIGNON_USER, APPLICATION_USER, ANONYMOUS_USER, SERVER_USER].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



39
40
41
# File 'lib/postfinancecheckout-ruby-sdk/models/user_type.rb', line 39

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



46
47
48
49
# File 'lib/postfinancecheckout-ruby-sdk/models/user_type.rb', line 46

def build_from_hash(value)
  return value if UserType.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #UserType"
end