Class: Io::Flow::V0::Models::DeliveryWindowLocation

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) ⇒ DeliveryWindowLocation

Returns a new instance of DeliveryWindowLocation.



11796
11797
11798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11796

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11794
11795
11796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11794

def value
  @value
end

Class Method Details

.ALLObject



11816
11817
11818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11816

def DeliveryWindowLocation.ALL
  @@all ||= [DeliveryWindowLocation.center, DeliveryWindowLocation.crossdock, DeliveryWindowLocation.customer]
end

.apply(value) ⇒ Object

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



11801
11802
11803
11804
11805
11806
11807
11808
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11801

def DeliveryWindowLocation.apply(value)
  if value.instance_of?(DeliveryWindowLocation)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || DeliveryWindowLocation.new(value))
  end
end

.centerObject



11820
11821
11822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11820

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

.crossdockObject



11824
11825
11826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11824

def DeliveryWindowLocation.crossdock
  @@_crossdock ||= DeliveryWindowLocation.new('crossdock')
end

.customerObject



11828
11829
11830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11828

def DeliveryWindowLocation.customer
  @@_customer ||= DeliveryWindowLocation.new('customer')
end

.from_string(value) ⇒ Object

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



11811
11812
11813
11814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11811

def DeliveryWindowLocation.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  DeliveryWindowLocation.ALL.find { |v| v.value == value }
end

Instance Method Details

#to_hashObject



11832
11833
11834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11832

def to_hash
  value
end