Class: ReliefWebAPI::ProfilePost

Inherits:
Object
  • Object
show all
Defined in:
lib/reliefweb-api/models/profile_post.rb

Constant Summary collapse

FULL =
'full'.freeze
LIST =
'list'.freeze
MINIMAL =
'minimal'.freeze

Instance Method Summary collapse

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string



25
26
27
28
29
# File 'lib/reliefweb-api/models/profile_post.rb', line 25

def build_from_hash(value)
  constantValues = ProfilePost.constants.select { |c| ProfilePost::const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #ProfilePost" if constantValues.empty?
  value
end