Class: Io::Flow::V0::Models::DeliveryWindowComponentSource

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ DeliveryWindowComponentSource

Returns a new instance of DeliveryWindowComponentSource.



18759
18760
18761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18759

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18757
18758
18759
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18757

def value
  @value
end

Class Method Details

.apply(value) ⇒ Object

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



18764
18765
18766
18767
18768
18769
18770
18771
# 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

.carrierObject



18791
18792
18793
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18791

def DeliveryWindowComponentSource.carrier
  @@_carrier ||= DeliveryWindowComponentSource.new('carrier')
end

.centerObject



18795
18796
18797
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18795

def DeliveryWindowComponentSource.center
  @@_center ||= DeliveryWindowComponentSource.new('center')
end

.flowObject



18783
18784
18785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18783

def DeliveryWindowComponentSource.flow
  @@_flow ||= DeliveryWindowComponentSource.new('flow')
end

.from_string(value) ⇒ Object

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



18774
18775
18776
18777
# 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

.mixedObject

A delivery estimate may be a combination of multiple sources



18800
18801
18802
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18800

def DeliveryWindowComponentSource.mixed
  @@_mixed ||= DeliveryWindowComponentSource.new('mixed')
end

.organizationObject



18787
18788
18789
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18787

def DeliveryWindowComponentSource.organization
  @@_organization ||= DeliveryWindowComponentSource.new('organization')
end

Instance Method Details

#to_hashObject



18804
18805
18806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18804

def to_hash
  value
end