Class: Notifo::ResizeMode

Inherits:
Object
  • Object
show all
Defined in:
lib/notifo/models/resize_mode.rb

Constant Summary collapse

CROP =
'Crop'.freeze
CROP_UPSIZE =
'CropUpsize'.freeze
PAD =
'Pad'.freeze
BOX_PAD =
'BoxPad'.freeze
MAX =
'Max'.freeze
MIN =
'Min'.freeze
STRETCH =
'Stretch'.freeze

Instance Method Summary collapse

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



27
28
29
30
31
# File 'lib/notifo/models/resize_mode.rb', line 27

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