Class: Io::Flow::V0::Models::TierEstimateType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TierEstimateType
- 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 TierEstimateType for this value, creating a new instance for an unknown value.
-
.calculated ⇒ Object
Displays the calculated delivery window estimate next to the shipping tier name.
-
.custom ⇒ Object
Shows a custom label next to the shipping tier name instead of a delivery window estimate.
-
.from_string(value) ⇒ Object
Returns the instance of TierEstimateType for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ TierEstimateType
constructor
A new instance of TierEstimateType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ TierEstimateType
Returns a new instance of TierEstimateType.
20714 20715 20716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20714 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20712 20713 20714 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20712 def value @value end |
Class Method Details
.ALL ⇒ Object
20734 20735 20736 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20734 def TierEstimateType.ALL @@all ||= [TierEstimateType.calculated, TierEstimateType.custom] end |
.apply(value) ⇒ Object
Returns the instance of TierEstimateType for this value, creating a new instance for an unknown value
20719 20720 20721 20722 20723 20724 20725 20726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20719 def TierEstimateType.apply(value) if value.instance_of?(TierEstimateType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || TierEstimateType.new(value)) end end |
.calculated ⇒ Object
Displays the calculated delivery window estimate next to the shipping tier name.
20740 20741 20742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20740 def TierEstimateType.calculated @@_calculated ||= TierEstimateType.new('calculated') end |
.custom ⇒ Object
Shows a custom label next to the shipping tier name instead of a delivery window estimate.
20746 20747 20748 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20746 def TierEstimateType.custom @@_custom ||= TierEstimateType.new('custom') end |
.from_string(value) ⇒ Object
Returns the instance of TierEstimateType for this value, or nil if not found
20729 20730 20731 20732 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20729 def TierEstimateType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) TierEstimateType.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
20750 20751 20752 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20750 def to_hash value end |