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.



14222
14223
14224
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14222

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14220
14221
14222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14220

def value
  @value
end

Class Method Details

.ALLObject



14242
14243
14244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14242

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



14227
14228
14229
14230
14231
14232
14233
14234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14227

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



14246
14247
14248
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14246

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

.crossdockObject



14250
14251
14252
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14250

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

.customerObject



14254
14255
14256
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14254

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



14237
14238
14239
14240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14237

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



14258
14259
14260
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14258

def to_hash
  value
end