Class: PinterestSdkClient::StandardPinMetricTypes

Inherits:
Object
  • Object
show all
Defined in:
lib/pinterest_sdk/models/standard_pin_metric_types.rb

Constant Summary collapse

IMPRESSION =
"IMPRESSION".freeze
OUTBOUND_CLICK =
"OUTBOUND_CLICK".freeze
PIN_CLICK =
"PIN_CLICK".freeze
SAVE =
"SAVE".freeze
SAVE_RATE =
"SAVE_RATE".freeze
TOTAL_COMMENTS =
"TOTAL_COMMENTS".freeze
TOTAL_REACTIONS =
"TOTAL_REACTIONS".freeze
USER_FOLLOW =
"USER_FOLLOW".freeze
PROFILE_VISIT =
"PROFILE_VISIT".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



28
29
30
# File 'lib/pinterest_sdk/models/standard_pin_metric_types.rb', line 28

def self.all_vars
  @all_vars ||= [IMPRESSION, OUTBOUND_CLICK, PIN_CLICK, SAVE, SAVE_RATE, TOTAL_COMMENTS, TOTAL_REACTIONS, USER_FOLLOW, PROFILE_VISIT].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/pinterest_sdk/models/standard_pin_metric_types.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/pinterest_sdk/models/standard_pin_metric_types.rb', line 42

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