Class: Io::Flow::V0::Models::DeliveryWindowComponentSource
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DeliveryWindowComponentSource
- 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 DeliveryWindowComponentSource for this value, creating a new instance for an unknown value.
- .carrier ⇒ Object
- .center ⇒ Object
- .flow ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of DeliveryWindowComponentSource for this value, or nil if not found.
-
.mixed ⇒ Object
A delivery estimate may be a combination of multiple sources.
- .organization ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ DeliveryWindowComponentSource
constructor
A new instance of DeliveryWindowComponentSource.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ DeliveryWindowComponentSource
Returns a new instance of DeliveryWindowComponentSource.
14631 14632 14633 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14631 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14629 14630 14631 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14629 def value @value end |
Class Method Details
.ALL ⇒ Object
14651 14652 14653 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14651 def DeliveryWindowComponentSource.ALL @@all ||= [DeliveryWindowComponentSource.flow, DeliveryWindowComponentSource.organization, DeliveryWindowComponentSource.carrier, DeliveryWindowComponentSource.center, DeliveryWindowComponentSource.mixed] end |
.apply(value) ⇒ Object
Returns the instance of DeliveryWindowComponentSource for this value, creating a new instance for an unknown value
14636 14637 14638 14639 14640 14641 14642 14643 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14636 def DeliveryWindowComponentSource.apply(value) if value.instance_of?(DeliveryWindowComponentSource) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || DeliveryWindowComponentSource.new(value)) end end |
.carrier ⇒ Object
14663 14664 14665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14663 def DeliveryWindowComponentSource.carrier @@_carrier ||= DeliveryWindowComponentSource.new('carrier') end |
.center ⇒ Object
14667 14668 14669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14667 def DeliveryWindowComponentSource.center @@_center ||= DeliveryWindowComponentSource.new('center') end |
.flow ⇒ Object
14655 14656 14657 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14655 def DeliveryWindowComponentSource.flow @@_flow ||= DeliveryWindowComponentSource.new('flow') end |
.from_string(value) ⇒ Object
Returns the instance of DeliveryWindowComponentSource for this value, or nil if not found
14646 14647 14648 14649 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14646 def DeliveryWindowComponentSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DeliveryWindowComponentSource.ALL.find { |v| v.value == value } end |
.mixed ⇒ Object
A delivery estimate may be a combination of multiple sources
14672 14673 14674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14672 def DeliveryWindowComponentSource.mixed @@_mixed ||= DeliveryWindowComponentSource.new('mixed') end |
.organization ⇒ Object
14659 14660 14661 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14659 def DeliveryWindowComponentSource.organization @@_organization ||= DeliveryWindowComponentSource.new('organization') end |
Instance Method Details
#to_hash ⇒ Object
14676 14677 14678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14676 def to_hash value end |