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.



10917
10918
10919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10917

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10915
10916
10917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10915

def value
  @value
end

Class Method Details

.ALLObject



10937
10938
10939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10937

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



10922
10923
10924
10925
10926
10927
10928
10929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10922

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



10941
10942
10943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10941

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

.crossdockObject



10945
10946
10947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10945

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

.customerObject



10949
10950
10951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10949

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



10932
10933
10934
10935
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10932

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



10953
10954
10955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10953

def to_hash
  value
end