Class: Io::Flow::V0::Models::PriceAccuracy
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PriceAccuracy
- 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 PriceAccuracy for this value, creating a new instance for an unknown value.
-
.calculated ⇒ Object
The price shown is accurate and will not change unless information already provided also changes.
-
.estimated_from_partial_destination ⇒ Object
The price shown is based on the best information provided; given a more precise address, the price may change.
-
.from_string(value) ⇒ Object
Returns the instance of PriceAccuracy for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ PriceAccuracy
constructor
A new instance of PriceAccuracy.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PriceAccuracy
Returns a new instance of PriceAccuracy.
17703 17704 17705 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17703 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17701 17702 17703 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17701 def value @value end |
Class Method Details
.ALL ⇒ Object
17723 17724 17725 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17723 def PriceAccuracy.ALL @@all ||= [PriceAccuracy.calculated, PriceAccuracy.estimated_from_partial_destination] end |
.apply(value) ⇒ Object
Returns the instance of PriceAccuracy for this value, creating a new instance for an unknown value
17708 17709 17710 17711 17712 17713 17714 17715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17708 def PriceAccuracy.apply(value) if value.instance_of?(PriceAccuracy) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || PriceAccuracy.new(value)) end end |
.calculated ⇒ Object
The price shown is accurate and will not change unless information already provided also changes.
17729 17730 17731 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17729 def PriceAccuracy.calculated @@_calculated ||= PriceAccuracy.new('calculated') end |
.estimated_from_partial_destination ⇒ Object
The price shown is based on the best information provided; given a more precise address, the price may change.
17735 17736 17737 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17735 def PriceAccuracy.estimated_from_partial_destination @@_estimated_from_partial_destination ||= PriceAccuracy.new('estimated_from_partial_destination') end |
.from_string(value) ⇒ Object
Returns the instance of PriceAccuracy for this value, or nil if not found
17718 17719 17720 17721 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17718 def PriceAccuracy.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PriceAccuracy.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
17739 17740 17741 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17739 def to_hash value end |