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.



11048
11049
11050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11048

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11046
11047
11048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11046

def value
  @value
end

Class Method Details

.ALLObject



11068
11069
11070
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11068

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



11053
11054
11055
11056
11057
11058
11059
11060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11053

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



11072
11073
11074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11072

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

.crossdockObject



11076
11077
11078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11076

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

.customerObject



11080
11081
11082
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11080

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



11063
11064
11065
11066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11063

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



11084
11085
11086
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11084

def to_hash
  value
end