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.



14557
14558
14559
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14557

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14555
14556
14557
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14555

def value
  @value
end

Class Method Details

.ALLObject



14577
14578
14579
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14577

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



14562
14563
14564
14565
14566
14567
14568
14569
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14562

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



14572
14573
14574
14575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14572

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

.not_shownObject



14581
14582
14583
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14581

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

.opted_inObject



14585
14586
14587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14585

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

.opted_outObject



14589
14590
14591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14589

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

Instance Method Details

#to_hashObject



14593
14594
14595
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14593

def to_hash
  value
end