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.
16029 16030 16031 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16029 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16027 16028 16029 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16027 def value @value end |
Class Method Details
.ALL ⇒ Object
16049 16050 16051 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16049 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
16034 16035 16036 16037 16038 16039 16040 16041 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16034 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.
16055 16056 16057 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16055 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.
16061 16062 16063 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16061 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
16044 16045 16046 16047 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16044 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
16065 16066 16067 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16065 def to_hash value end |