Class: BillingApi::ReservationStateEnum

Inherits:
Object
  • Object
show all
Defined in:
lib/pnap_billing_api/models/reservation_state_enum.rb

Constant Summary collapse

REQUESTED =
"REQUESTED".freeze
DECLINED =
"DECLINED".freeze
IN_REVIEW =
"IN_REVIEW".freeze
SETTING_UP =
"SETTING_UP".freeze
ACTIVE =
"ACTIVE".freeze
EXPIRED =
"EXPIRED".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



25
26
27
# File 'lib/pnap_billing_api/models/reservation_state_enum.rb', line 25

def self.all_vars
  @all_vars ||= [REQUESTED, DECLINED, IN_REVIEW, SETTING_UP, ACTIVE, EXPIRED].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



32
33
34
# File 'lib/pnap_billing_api/models/reservation_state_enum.rb', line 32

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



39
40
41
42
# File 'lib/pnap_billing_api/models/reservation_state_enum.rb', line 39

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