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.
16430 16431 16432 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16430 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16428 16429 16430 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16428 def value @value end |
Class Method Details
.ALL ⇒ Object
16450 16451 16452 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16450 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
16435 16436 16437 16438 16439 16440 16441 16442 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16435 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
16460 16461 16462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16460 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
16445 16446 16447 16448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16445 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
16455 16456 16457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16455 def LanePreselectPreference.lowest_cost @@_lowest_cost ||= LanePreselectPreference.new('lowest_cost') end |
Instance Method Details
#to_hash ⇒ Object
16464 16465 16466 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16464 def to_hash value end |