class Io::Flow::V0::Models::LaneStrategy

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22045
def LaneStrategy.ALL
  @@all ||= [LaneStrategy.oldest, LaneStrategy.fastest, LaneStrategy.lowest_cost, LaneStrategy.highest_priority]
end
apply(value) click to toggle source

Returns the instance of LaneStrategy for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 22030
def LaneStrategy.apply(value)
  if value.instance_of?(LaneStrategy)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || LaneStrategy.new(value))
  end
end
fastest() click to toggle source

Optimize for fastest average time in transit across all tiers from the center on the lane

# File lib/flow_commerce/flow_api_v0_client.rb, line 22056
def LaneStrategy.fastest
  @@_fastest ||= LaneStrategy.new('fastest')
end
from_string(value) click to toggle source

Returns the instance of LaneStrategy for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 22040
def LaneStrategy.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  LaneStrategy.ALL.find { |v| v.value == value }
end
highest_priority() click to toggle source

Get the highest priority center for the shipping lane

# File lib/flow_commerce/flow_api_v0_client.rb, line 22066
def LaneStrategy.highest_priority
  @@_highest_priority ||= LaneStrategy.new('highest_priority')
end
lowest_cost() click to toggle source

Optimize for lowest average cost across all tiers from the center on the lane

# File lib/flow_commerce/flow_api_v0_client.rb, line 22061
def LaneStrategy.lowest_cost
  @@_lowest_cost ||= LaneStrategy.new('lowest_cost')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22025
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
oldest() click to toggle source

Use the oldest center by creation date.

# File lib/flow_commerce/flow_api_v0_client.rb, line 22050
def LaneStrategy.oldest
  @@_oldest ||= LaneStrategy.new('oldest')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22070
def to_hash
  value
end