Class: Io::Flow::V0::Models::PhysicalDeliverySpecialSerivce

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) ⇒ PhysicalDeliverySpecialSerivce



17657
17658
17659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17657

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17655
17656
17657
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17655

def value
  @value
end

Class Method Details

.ALLObject



17677
17678
17679
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17677

def PhysicalDeliverySpecialSerivce.ALL
  @@all ||= [PhysicalDeliverySpecialSerivce.cold_storage, PhysicalDeliverySpecialSerivce.hazardous, PhysicalDeliverySpecialSerivce.perishable]
end

.apply(value) ⇒ Object

Returns the instance of PhysicalDeliverySpecialSerivce for this value, creating a new instance for an unknown value



17662
17663
17664
17665
17666
17667
17668
17669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17662

def PhysicalDeliverySpecialSerivce.apply(value)
  if value.instance_of?(PhysicalDeliverySpecialSerivce)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PhysicalDeliverySpecialSerivce.new(value))
  end
end

.cold_storageObject



17681
17682
17683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17681

def PhysicalDeliverySpecialSerivce.cold_storage
  @@_cold_storage ||= PhysicalDeliverySpecialSerivce.new('cold_storage')
end

.from_string(value) ⇒ Object

Returns the instance of PhysicalDeliverySpecialSerivce for this value, or nil if not found



17672
17673
17674
17675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17672

def PhysicalDeliverySpecialSerivce.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PhysicalDeliverySpecialSerivce.ALL.find { |v| v.value == value }
end

.hazardousObject



17685
17686
17687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17685

def PhysicalDeliverySpecialSerivce.hazardous
  @@_hazardous ||= PhysicalDeliverySpecialSerivce.new('hazardous')
end

.perishableObject



17689
17690
17691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17689

def PhysicalDeliverySpecialSerivce.perishable
  @@_perishable ||= PhysicalDeliverySpecialSerivce.new('perishable')
end

Instance Method Details

#to_hashObject



17693
17694
17695
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17693

def to_hash
  value
end