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.
16652 16653 16654 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16652 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16650 16651 16652 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16650 def value @value end |
Class Method Details
.ALL ⇒ Object
16672 16673 16674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16672 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
16657 16658 16659 16660 16661 16662 16663 16664 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16657 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
16682 16683 16684 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16682 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
16667 16668 16669 16670 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16667 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
16677 16678 16679 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16677 def LanePreselectPreference.lowest_cost @@_lowest_cost ||= LanePreselectPreference.new('lowest_cost') end |
Instance Method Details
#to_hash ⇒ Object
16686 16687 16688 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16686 def to_hash value end |