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.



13245
13246
13247
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13245

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13243
13244
13245
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13243

def value
  @value
end

Class Method Details

.ALLObject



13265
13266
13267
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13265

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



13250
13251
13252
13253
13254
13255
13256
13257
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13250

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



13269
13270
13271
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13269

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

.crossdockObject



13273
13274
13275
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13273

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

.customerObject



13277
13278
13279
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13277

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



13260
13261
13262
13263
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13260

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



13281
13282
13283
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13281

def to_hash
  value
end