Class: Algolia::Ingestion::RunReasonCode

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/models/ingestion/run_reason_code.rb

Constant Summary collapse

INTERNAL =
"internal".freeze
CANCELLED =
"cancelled".freeze
CRITICAL =
"critical".freeze
NO_EVENTS =
"no_events".freeze
TOO_MANY_ERRORS =
"too_many_errors".freeze
LACKING_EVENTS =
"lacking_events".freeze
OK =
"ok".freeze
BLOCKING =
"blocking".freeze
IDLE =
"idle".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



21
22
23
# File 'lib/algolia/models/ingestion/run_reason_code.rb', line 21

def self.all_vars
  @all_vars ||= [INTERNAL, CANCELLED, CRITICAL, NO_EVENTS, TOO_MANY_ERRORS, LACKING_EVENTS, OK, BLOCKING, IDLE].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string



28
29
30
# File 'lib/algolia/models/ingestion/run_reason_code.rb', line 28

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



35
36
37
38
# File 'lib/algolia/models/ingestion/run_reason_code.rb', line 35

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