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.
15617 15618 15619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15617 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15615 15616 15617 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15615 def value @value end |
Class Method Details
.ALL ⇒ Object
15637 15638 15639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15637 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
15622 15623 15624 15625 15626 15627 15628 15629 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15622 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.
15643 15644 15645 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15643 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.
15649 15650 15651 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15649 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
15632 15633 15634 15635 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15632 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
15653 15654 15655 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15653 def to_hash value end |