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.
20172 20173 20174 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20172 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20170 20171 20172 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20170 def value @value end |
Class Method Details
.ALL ⇒ Object
20192 20193 20194 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20192 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
20177 20178 20179 20180 20181 20182 20183 20184 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20177 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.
20198 20199 20200 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20198 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.
20204 20205 20206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20204 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
20187 20188 20189 20190 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20187 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
20208 20209 20210 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20208 def to_hash value end |