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.
11440 11441 11442 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11440 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
11438 11439 11440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11438 def value @value end |
Class Method Details
.ALL ⇒ Object
11460 11461 11462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11460 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
11445 11446 11447 11448 11449 11450 11451 11452 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11445 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
11464 11465 11466 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11464 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
11455 11456 11457 11458 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11455 def DeliveryOptionCostDetailSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DeliveryOptionCostDetailSource.ALL.find { |v| v.value == value } end |
.ratecard ⇒ Object
11468 11469 11470 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11468 def DeliveryOptionCostDetailSource.ratecard @@_ratecard ||= DeliveryOptionCostDetailSource.new('ratecard') end |
Instance Method Details
#to_hash ⇒ Object
11472 11473 11474 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11472 def to_hash value end |