Class: Io::Flow::V0::Models::CountryPickerSource
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CountryPickerSource
- 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 CountryPickerSource for this value, creating a new instance for an unknown value.
-
.destination ⇒ Object
Indicates we should build the list of countries based on all countries to which you have a rate card (ie. all valid destination countries).
-
.experience ⇒ Object
Indicates we should build the list of countries based on each active experience country.
-
.from_string(value) ⇒ Object
Returns the instance of CountryPickerSource for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ CountryPickerSource
constructor
A new instance of CountryPickerSource.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CountryPickerSource
Returns a new instance of CountryPickerSource.
16074 16075 16076 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16074 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16072 16073 16074 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16072 def value @value end |
Class Method Details
.ALL ⇒ Object
16094 16095 16096 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16094 def CountryPickerSource.ALL @@all ||= [CountryPickerSource.experience, CountryPickerSource.destination] end |
.apply(value) ⇒ Object
Returns the instance of CountryPickerSource for this value, creating a new instance for an unknown value
16079 16080 16081 16082 16083 16084 16085 16086 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16079 def CountryPickerSource.apply(value) if value.instance_of?(CountryPickerSource) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CountryPickerSource.new(value)) end end |
.destination ⇒ Object
Indicates we should build the list of countries based on all countries to which you have a rate card (ie. all valid destination countries)
16106 16107 16108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16106 def CountryPickerSource.destination @@_destination ||= CountryPickerSource.new('destination') end |
.experience ⇒ Object
Indicates we should build the list of countries based on each active experience country
16100 16101 16102 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16100 def CountryPickerSource.experience @@_experience ||= CountryPickerSource.new('experience') end |
.from_string(value) ⇒ Object
Returns the instance of CountryPickerSource for this value, or nil if not found
16089 16090 16091 16092 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16089 def CountryPickerSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CountryPickerSource.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
16110 16111 16112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16110 def to_hash value end |