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.



9623
9624
9625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9623

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9621
9622
9623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9621

def value
  @value
end

Class Method Details

.ALLObject



9643
9644
9645
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9643

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



9628
9629
9630
9631
9632
9633
9634
9635
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9628

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



9647
9648
9649
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9647

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

.crossdockObject



9651
9652
9653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9651

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

.customerObject



9655
9656
9657
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9655

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



9638
9639
9640
9641
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9638

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



9659
9660
9661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9659

def to_hash
  value
end