Class: Io::Flow::V0::Models::DeliveryOptionCostDetailSource
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DeliveryOptionCostDetailSource
- 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 DeliveryOptionCostDetailSource for this value, creating a new instance for an unknown value.
- .center ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of DeliveryOptionCostDetailSource for this value, or nil if not found.
- .ratecard ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ DeliveryOptionCostDetailSource
constructor
A new instance of DeliveryOptionCostDetailSource.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ DeliveryOptionCostDetailSource
Returns a new instance of DeliveryOptionCostDetailSource.
18717 18718 18719 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18717 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18715 18716 18717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18715 def value @value end |
Class Method Details
.ALL ⇒ Object
18737 18738 18739 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18737 def DeliveryOptionCostDetailSource.ALL @@all ||= [DeliveryOptionCostDetailSource.center, DeliveryOptionCostDetailSource.ratecard] end |
.apply(value) ⇒ Object
Returns the instance of DeliveryOptionCostDetailSource for this value, creating a new instance for an unknown value
18722 18723 18724 18725 18726 18727 18728 18729 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18722 def DeliveryOptionCostDetailSource.apply(value) if value.instance_of?(DeliveryOptionCostDetailSource) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || DeliveryOptionCostDetailSource.new(value)) end end |
.center ⇒ Object
18741 18742 18743 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18741 def DeliveryOptionCostDetailSource.center @@_center ||= DeliveryOptionCostDetailSource.new('center') end |
.from_string(value) ⇒ Object
Returns the instance of DeliveryOptionCostDetailSource for this value, or nil if not found
18732 18733 18734 18735 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18732 def DeliveryOptionCostDetailSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DeliveryOptionCostDetailSource.ALL.find { |v| v.value == value } end |
.ratecard ⇒ Object
18745 18746 18747 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18745 def DeliveryOptionCostDetailSource.ratecard @@_ratecard ||= DeliveryOptionCostDetailSource.new('ratecard') end |
Instance Method Details
#to_hash ⇒ Object
18749 18750 18751 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18749 def to_hash value end |