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.



10636
10637
10638
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10636

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10634
10635
10636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10634

def value
  @value
end

Class Method Details

.ALLObject



10656
10657
10658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10656

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



10641
10642
10643
10644
10645
10646
10647
10648
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10641

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



10660
10661
10662
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10660

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

.crossdockObject



10664
10665
10666
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10664

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

.customerObject



10668
10669
10670
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10668

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



10651
10652
10653
10654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10651

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



10672
10673
10674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10672

def to_hash
  value
end