Class: Io::Flow::V0::Models::ReturnItemStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReturnItemStatus
- 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 ReturnItemStatus for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of ReturnItemStatus for this value, or nil if not found.
-
.non_returnable ⇒ Object
The item in the catalog cannot be returned.
-
.returnable ⇒ Object
The item in the catalog can be returned.
Instance Method Summary collapse
-
#initialize(value) ⇒ ReturnItemStatus
constructor
A new instance of ReturnItemStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ReturnItemStatus
22679 22680 22681 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22679 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
22677 22678 22679 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22677 def value @value end |
Class Method Details
.ALL ⇒ Object
22699 22700 22701 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22699 def ReturnItemStatus.ALL @@all ||= [ReturnItemStatus.returnable, ReturnItemStatus.non_returnable] end |
.apply(value) ⇒ Object
Returns the instance of ReturnItemStatus for this value, creating a new instance for an unknown value
22684 22685 22686 22687 22688 22689 22690 22691 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22684 def ReturnItemStatus.apply(value) if value.instance_of?(ReturnItemStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ReturnItemStatus.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of ReturnItemStatus for this value, or nil if not found
22694 22695 22696 22697 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22694 def ReturnItemStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ReturnItemStatus.ALL.find { |v| v.value == value } end |
.non_returnable ⇒ Object
The item in the catalog cannot be returned
22709 22710 22711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22709 def ReturnItemStatus.non_returnable @@_non_returnable ||= ReturnItemStatus.new('non-returnable') end |
.returnable ⇒ Object
The item in the catalog can be returned
22704 22705 22706 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22704 def ReturnItemStatus.returnable @@_returnable ||= ReturnItemStatus.new('returnable') end |
Instance Method Details
#to_hash ⇒ Object
22713 22714 22715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22713 def to_hash value end |