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.
14098 14099 14100 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14098 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14096 14097 14098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14096 def value @value end |
Class Method Details
.ALL ⇒ Object
14118 14119 14120 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14118 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
14103 14104 14105 14106 14107 14108 14109 14110 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14103 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
14122 14123 14124 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14122 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
14113 14114 14115 14116 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14113 def DeliveryOptionCostDetailSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DeliveryOptionCostDetailSource.ALL.find { |v| v.value == value } end |
.ratecard ⇒ Object
14126 14127 14128 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14126 def DeliveryOptionCostDetailSource.ratecard @@_ratecard ||= DeliveryOptionCostDetailSource.new('ratecard') end |
Instance Method Details
#to_hash ⇒ Object
14130 14131 14132 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14130 def to_hash value end |