Class: Io::Flow::V0::Models::ShipmentRecipient
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShipmentRecipient
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of ShipmentRecipient for this value, creating a new instance for an unknown value.
-
.crossdock ⇒ Object
Outbound shipment to a crossdock.
-
.customer ⇒ Object
Outbound shipment to the customer.
-
.from_string(value) ⇒ Object
Returns the instance of ShipmentRecipient for this value, or nil if not found.
-
.return ⇒ Object
Inbound or return shipment.
Instance Method Summary collapse
-
#initialize(value) ⇒ ShipmentRecipient
constructor
A new instance of ShipmentRecipient.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ShipmentRecipient
Returns a new instance of ShipmentRecipient.
19369 19370 19371 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19369 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
19367 19368 19369 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19367 def value @value end |
Class Method Details
.ALL ⇒ Object
19389 19390 19391 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19389 def ShipmentRecipient.ALL @@all ||= [ShipmentRecipient.customer, ShipmentRecipient.return, ShipmentRecipient.crossdock] end |
.apply(value) ⇒ Object
Returns the instance of ShipmentRecipient for this value, creating a new instance for an unknown value
19374 19375 19376 19377 19378 19379 19380 19381 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19374 def ShipmentRecipient.apply(value) if value.instance_of?(ShipmentRecipient) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ShipmentRecipient.new(value)) end end |
.crossdock ⇒ Object
Outbound shipment to a crossdock
19404 19405 19406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19404 def ShipmentRecipient.crossdock @@_crossdock ||= ShipmentRecipient.new('crossdock') end |
.customer ⇒ Object
Outbound shipment to the customer
19394 19395 19396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19394 def ShipmentRecipient.customer @@_customer ||= ShipmentRecipient.new('customer') end |
.from_string(value) ⇒ Object
Returns the instance of ShipmentRecipient for this value, or nil if not found
19384 19385 19386 19387 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19384 def ShipmentRecipient.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ShipmentRecipient.ALL.find { |v| v.value == value } end |
.return ⇒ Object
Inbound or return shipment
19399 19400 19401 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19399 def ShipmentRecipient.return @@_return ||= ShipmentRecipient.new('return') end |
Instance Method Details
#to_hash ⇒ Object
19408 19409 19410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19408 def to_hash value end |