Class: Io::Flow::V0::Models::AppliedPromotionType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AppliedPromotionType
- 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 AppliedPromotionType for this value, creating a new instance for an unknown value.
- .free_shipping ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of AppliedPromotionType for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ AppliedPromotionType
constructor
A new instance of AppliedPromotionType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AppliedPromotionType
Returns a new instance of AppliedPromotionType.
5639 5640 5641 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5639 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
5637 5638 5639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5637 def value @value end |
Class Method Details
.ALL ⇒ Object
5659 5660 5661 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5659 def AppliedPromotionType.ALL @@all ||= [AppliedPromotionType.free_shipping] end |
.apply(value) ⇒ Object
Returns the instance of AppliedPromotionType for this value, creating a new instance for an unknown value
5644 5645 5646 5647 5648 5649 5650 5651 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5644 def AppliedPromotionType.apply(value) if value.instance_of?(AppliedPromotionType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || AppliedPromotionType.new(value)) end end |
.free_shipping ⇒ Object
5663 5664 5665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5663 def AppliedPromotionType.free_shipping @@_free_shipping ||= AppliedPromotionType.new('free_shipping') end |
.from_string(value) ⇒ Object
Returns the instance of AppliedPromotionType for this value, or nil if not found
5654 5655 5656 5657 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5654 def AppliedPromotionType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AppliedPromotionType.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
5667 5668 5669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5667 def to_hash value end |