Class: Io::Flow::V0::Models::LanePreselectPreference
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LanePreselectPreference
- 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 LanePreselectPreference for this value, creating a new instance for an unknown value.
-
.default_tier ⇒ Object
Manually designate a tier in the shipping lane as the default.
-
.from_string(value) ⇒ Object
Returns the instance of LanePreselectPreference for this value, or nil if not found.
-
.lowest_cost ⇒ Object
Preselect the lowest cost tier in the shipping lane.
Instance Method Summary collapse
-
#initialize(value) ⇒ LanePreselectPreference
constructor
A new instance of LanePreselectPreference.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ LanePreselectPreference
Returns a new instance of LanePreselectPreference.
20330 20331 20332 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20330 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20328 20329 20330 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20328 def value @value end |
Class Method Details
.ALL ⇒ Object
20350 20351 20352 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20350 def LanePreselectPreference.ALL @@all ||= [LanePreselectPreference.lowest_cost, LanePreselectPreference.default_tier] end |
.apply(value) ⇒ Object
Returns the instance of LanePreselectPreference for this value, creating a new instance for an unknown value
20335 20336 20337 20338 20339 20340 20341 20342 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20335 def LanePreselectPreference.apply(value) if value.instance_of?(LanePreselectPreference) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || LanePreselectPreference.new(value)) end end |
.default_tier ⇒ Object
Manually designate a tier in the shipping lane as the default
20360 20361 20362 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20360 def LanePreselectPreference.default_tier @@_default_tier ||= LanePreselectPreference.new('default_tier') end |
.from_string(value) ⇒ Object
Returns the instance of LanePreselectPreference for this value, or nil if not found
20345 20346 20347 20348 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20345 def LanePreselectPreference.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) LanePreselectPreference.ALL.find { |v| v.value == value } end |
.lowest_cost ⇒ Object
Preselect the lowest cost tier in the shipping lane
20355 20356 20357 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20355 def LanePreselectPreference.lowest_cost @@_lowest_cost ||= LanePreselectPreference.new('lowest_cost') end |
Instance Method Details
#to_hash ⇒ Object
20364 20365 20366 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20364 def to_hash value end |