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.



13963
13964
13965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13963

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13961
13962
13963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13961

def value
  @value
end

Class Method Details

.ALLObject



13983
13984
13985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13983

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



13968
13969
13970
13971
13972
13973
13974
13975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13968

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



13987
13988
13989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13987

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

.crossdockObject



13991
13992
13993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13991

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

.customerObject



13995
13996
13997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13995

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



13978
13979
13980
13981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13978

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



13999
14000
14001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13999

def to_hash
  value
end