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.
16696 16697 16698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16696 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16694 16695 16696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16694 def value @value end |
Class Method Details
.ALL ⇒ Object
16716 16717 16718 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16716 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
16701 16702 16703 16704 16705 16706 16707 16708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16701 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.
16722 16723 16724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16722 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.
16728 16729 16730 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16728 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
16711 16712 16713 16714 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16711 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
16732 16733 16734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16732 def to_hash value end |