Class: VoucherifySdk::EarningRuleEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/models/earning_rule_event.rb

Constant Summary collapse

ORDER_PAID =
"order.paid".freeze
CUSTOMER_SEGMENT_ENTERED =
"customer.segment.entered".freeze
CUSTOM_EVENT =
"custom_event".freeze
CUSTOMER_LOYALTY_TIER_UPGRADED =
"customer.loyalty.tier.upgraded".freeze
CUSTOMER_LOYALTY_TIER_DOWNGRADED =
"customer.loyalty.tier.downgraded".freeze
CUSTOMER_LOYALTY_TIER_PROLONGED =
"customer.loyalty.tier.prolonged".freeze
CUSTOMER_LOYALTY_TIER_JOINED =
"customer.loyalty.tier.joined".freeze
CUSTOMER_LOYALTY_TIER_LEFT =
"customer.loyalty.tier.left".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



27
28
29
# File 'lib/VoucherifySdk/models/earning_rule_event.rb', line 27

def self.all_vars
  @all_vars ||= [ORDER_PAID, CUSTOMER_SEGMENT_ENTERED, CUSTOM_EVENT, CUSTOMER_LOYALTY_TIER_UPGRADED, CUSTOMER_LOYALTY_TIER_DOWNGRADED, CUSTOMER_LOYALTY_TIER_PROLONGED, CUSTOMER_LOYALTY_TIER_JOINED, CUSTOMER_LOYALTY_TIER_LEFT].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



34
35
36
# File 'lib/VoucherifySdk/models/earning_rule_event.rb', line 34

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



41
42
43
44
# File 'lib/VoucherifySdk/models/earning_rule_event.rb', line 41

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