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.
17650 17651 17652 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17650 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17648 17649 17650 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17648 def value @value end |
Class Method Details
.ALL ⇒ Object
17670 17671 17672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17670 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
17655 17656 17657 17658 17659 17660 17661 17662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17655 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
17680 17681 17682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17680 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
17665 17666 17667 17668 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17665 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
17675 17676 17677 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17675 def LanePreselectPreference.lowest_cost @@_lowest_cost ||= LanePreselectPreference.new('lowest_cost') end |
Instance Method Details
#to_hash ⇒ Object
17684 17685 17686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17684 def to_hash value end |