Class: Zyphr::WorkflowStepType

Inherits:
Object
  • Object
show all
Defined in:
lib/zyphr/models/workflow_step_type.rb

Constant Summary collapse

EMAIL =
"email".freeze
PUSH =
"push".freeze
SMS =
"sms".freeze
IN_APP =
"in_app".freeze
SLACK =
"slack".freeze
DISCORD =
"discord".freeze
TEAMS =
"teams".freeze
DELAY =
"delay".freeze
BRANCH =
"branch".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



28
29
30
# File 'lib/zyphr/models/workflow_step_type.rb', line 28

def self.all_vars
  @all_vars ||= [EMAIL, PUSH, SMS, IN_APP, SLACK, DISCORD, TEAMS, DELAY, BRANCH].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/zyphr/models/workflow_step_type.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/zyphr/models/workflow_step_type.rb', line 42

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