Class: Io::Flow::V0::Models::TierAvailability
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TierAvailability
- 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
-
.always ⇒ Object
The tier will always be considered to be offered for a customer order shipment.
-
.apply(value) ⇒ Object
Returns the instance of TierAvailability for this value, creating a new instance for an unknown value.
-
.backup ⇒ Object
Indicates that a tier should only be offered as a shipping option when ‘always` tiers are not available.
-
.from_string(value) ⇒ Object
Returns the instance of TierAvailability for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ TierAvailability
constructor
A new instance of TierAvailability.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ TierAvailability
Returns a new instance of TierAvailability.
21184 21185 21186 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21184 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
21182 21183 21184 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21182 def value @value end |
Class Method Details
.ALL ⇒ Object
21204 21205 21206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21204 def TierAvailability.ALL @@all ||= [TierAvailability.always, TierAvailability.backup] end |
.always ⇒ Object
The tier will always be considered to be offered for a customer order shipment
21209 21210 21211 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21209 def TierAvailability.always @@_always ||= TierAvailability.new('always') end |
.apply(value) ⇒ Object
Returns the instance of TierAvailability for this value, creating a new instance for an unknown value
21189 21190 21191 21192 21193 21194 21195 21196 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21189 def TierAvailability.apply(value) if value.instance_of?(TierAvailability) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || TierAvailability.new(value)) end end |
.backup ⇒ Object
Indicates that a tier should only be offered as a shipping option when ‘always` tiers are not available
21215 21216 21217 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21215 def TierAvailability.backup @@_backup ||= TierAvailability.new('backup') end |
.from_string(value) ⇒ Object
Returns the instance of TierAvailability for this value, or nil if not found
21199 21200 21201 21202 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21199 def TierAvailability.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) TierAvailability.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
21219 21220 21221 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21219 def to_hash value end |