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.
11998 11999 12000 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11998 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
11996 11997 11998 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11996 def value @value end |
Class Method Details
.ALL ⇒ Object
12018 12019 12020 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12018 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
12003 12004 12005 12006 12007 12008 12009 12010 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12003 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
12022 12023 12024 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12022 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
12013 12014 12015 12016 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12013 def DeliveryOptionCostDetailSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DeliveryOptionCostDetailSource.ALL.find { |v| v.value == value } end |
.ratecard ⇒ Object
12026 12027 12028 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12026 def DeliveryOptionCostDetailSource.ratecard @@_ratecard ||= DeliveryOptionCostDetailSource.new('ratecard') end |
Instance Method Details
#to_hash ⇒ Object
12030 12031 12032 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12030 def to_hash value end |