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

Returns a new instance of PhysicalDeliverySpecialSerivce.



18153
18154
18155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18153

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18151
18152
18153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18151

def value
  @value
end

Class Method Details

.ALLObject



18173
18174
18175
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18173

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



18158
18159
18160
18161
18162
18163
18164
18165
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18158

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



18177
18178
18179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18177

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



18168
18169
18170
18171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18168

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

.hazardousObject



18181
18182
18183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18181

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

.perishableObject



18185
18186
18187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18185

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

Instance Method Details

#to_hashObject



18189
18190
18191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18189

def to_hash
  value
end