Class: Api::ContractStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/jamm/api/models/v1_contract_status.rb

Constant Summary collapse

UNSPECIFIED =
"CONTRACT_STATUS_UNSPECIFIED".freeze
INITIAL =
"CONTRACT_STATUS_INITIAL".freeze
APPROVED =
"CONTRACT_STATUS_APPROVED".freeze
ACTIVATED =
"CONTRACT_STATUS_ACTIVATED".freeze
WAITING_EKYC =
"CONTRACT_STATUS_WAITING_EKYC".freeze
EXPIRED =
"CONTRACT_STATUS_EXPIRED".freeze
DEACTIVATED =
"CONTRACT_STATUS_DEACTIVATED".freeze
CANCELLED =
"CONTRACT_STATUS_CANCELLED".freeze
PENDING_CHARGE =
"CONTRACT_STATUS_PENDING_CHARGE".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



28
29
30
# File 'lib/jamm/api/models/v1_contract_status.rb', line 28

def self.all_vars
  @all_vars ||= [UNSPECIFIED, INITIAL, APPROVED, ACTIVATED, WAITING_EKYC, EXPIRED, DEACTIVATED, CANCELLED, PENDING_CHARGE].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



35
36
37
# File 'lib/jamm/api/models/v1_contract_status.rb', line 35

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



42
43
44
45
# File 'lib/jamm/api/models/v1_contract_status.rb', line 42

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