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.
16358 16359 16360 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16358 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16356 16357 16358 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16356 def value @value end |
Class Method Details
.ALL ⇒ Object
16378 16379 16380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16378 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
16363 16364 16365 16366 16367 16368 16369 16370 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16363 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
16388 16389 16390 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16388 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
16373 16374 16375 16376 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16373 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
16383 16384 16385 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16383 def LanePreselectPreference.lowest_cost @@_lowest_cost ||= LanePreselectPreference.new('lowest_cost') end |
Instance Method Details
#to_hash ⇒ Object
16392 16393 16394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16392 def to_hash value end |