Class: Io::Flow::V0::Models::OptinResponseType

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ OptinResponseType

Returns a new instance of OptinResponseType.



14081
14082
14083
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14081

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14079
14080
14081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14079

def value
  @value
end

Class Method Details

.ALLObject



14101
14102
14103
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14101

def OptinResponseType.ALL
  @@all ||= [OptinResponseType.not_shown, OptinResponseType.opted_in, OptinResponseType.opted_out]
end

.apply(value) ⇒ Object

Returns the instance of OptinResponseType for this value, creating a new instance for an unknown value



14086
14087
14088
14089
14090
14091
14092
14093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14086

def OptinResponseType.apply(value)
  if value.instance_of?(OptinResponseType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || OptinResponseType.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of OptinResponseType for this value, or nil if not found



14096
14097
14098
14099
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14096

def OptinResponseType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  OptinResponseType.ALL.find { |v| v.value == value }
end

.not_shownObject



14105
14106
14107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14105

def OptinResponseType.not_shown
  @@_not_shown ||= OptinResponseType.new('not_shown')
end

.opted_inObject



14109
14110
14111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14109

def OptinResponseType.opted_in
  @@_opted_in ||= OptinResponseType.new('opted_in')
end

.opted_outObject



14113
14114
14115
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14113

def OptinResponseType.opted_out
  @@_opted_out ||= OptinResponseType.new('opted_out')
end

Instance Method Details

#to_hashObject



14117
14118
14119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14117

def to_hash
  value
end