class Io::Flow::V0::Models::DeliveryWindowComponentSource

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18779
def DeliveryWindowComponentSource.ALL
  @@all ||= [DeliveryWindowComponentSource.flow, DeliveryWindowComponentSource.organization, DeliveryWindowComponentSource.carrier, DeliveryWindowComponentSource.center, DeliveryWindowComponentSource.mixed]
end
apply(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 18764
def DeliveryWindowComponentSource.apply(value)
  if value.instance_of?(DeliveryWindowComponentSource)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || DeliveryWindowComponentSource.new(value))
  end
end
carrier() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18791
def DeliveryWindowComponentSource.carrier
  @@_carrier ||= DeliveryWindowComponentSource.new('carrier')
end
center() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18795
def DeliveryWindowComponentSource.center
  @@_center ||= DeliveryWindowComponentSource.new('center')
end
flow() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18783
def DeliveryWindowComponentSource.flow
  @@_flow ||= DeliveryWindowComponentSource.new('flow')
end
from_string(value) click to toggle source

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

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

A delivery estimate may be a combination of multiple sources

# File lib/flow_commerce/flow_api_v0_client.rb, line 18800
def DeliveryWindowComponentSource.mixed
  @@_mixed ||= DeliveryWindowComponentSource.new('mixed')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18759
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
organization() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18787
def DeliveryWindowComponentSource.organization
  @@_organization ||= DeliveryWindowComponentSource.new('organization')
end

Public Instance Methods

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