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.
18759 18760 18761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18759 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18757 18758 18759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18757 def value @value end |
Class Method Details
.ALL ⇒ Object
18779 18780 18781 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18779 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
18764 18765 18766 18767 18768 18769 18770 18771 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18764 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
18791 18792 18793 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18791 def DeliveryWindowComponentSource.carrier @@_carrier ||= DeliveryWindowComponentSource.new('carrier') end |
.center ⇒ Object
18795 18796 18797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18795 def DeliveryWindowComponentSource.center @@_center ||= DeliveryWindowComponentSource.new('center') end |
.flow ⇒ Object
18783 18784 18785 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18783 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
18774 18775 18776 18777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18774 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
18800 18801 18802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18800 def DeliveryWindowComponentSource.mixed @@_mixed ||= DeliveryWindowComponentSource.new('mixed') end |
.organization ⇒ Object
18787 18788 18789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18787 def DeliveryWindowComponentSource.organization @@_organization ||= DeliveryWindowComponentSource.new('organization') end |
Instance Method Details
#to_hash ⇒ Object
18804 18805 18806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18804 def to_hash value end |