Class: Io::Flow::V0::Models::OptinResponseType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OptinResponseType
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of OptinResponseType for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of OptinResponseType for this value, or nil if not found.
- .not_shown ⇒ Object
- .opted_in ⇒ Object
- .opted_out ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ OptinResponseType
constructor
A new instance of OptinResponseType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ OptinResponseType
Returns a new instance of OptinResponseType.
22850 22851 22852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22850 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
22848 22849 22850 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22848 def value @value end |
Class Method Details
.ALL ⇒ Object
22870 22871 22872 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22870 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
22855 22856 22857 22858 22859 22860 22861 22862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22855 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
22865 22866 22867 22868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22865 def OptinResponseType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) OptinResponseType.ALL.find { |v| v.value == value } end |
.not_shown ⇒ Object
22874 22875 22876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22874 def OptinResponseType.not_shown @@_not_shown ||= OptinResponseType.new('not_shown') end |
.opted_in ⇒ Object
22878 22879 22880 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22878 def OptinResponseType.opted_in @@_opted_in ||= OptinResponseType.new('opted_in') end |
.opted_out ⇒ Object
22882 22883 22884 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22882 def OptinResponseType.opted_out @@_opted_out ||= OptinResponseType.new('opted_out') end |
Instance Method Details
#to_hash ⇒ Object
22886 22887 22888 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22886 def to_hash value end |