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
Returns a new instance of ReturnItemStatus.
19970 19971 19972 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19970 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
19968 19969 19970 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19968 def value @value end |
Class Method Details
.ALL ⇒ Object
19990 19991 19992 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19990 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
19975 19976 19977 19978 19979 19980 19981 19982 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19975 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
19985 19986 19987 19988 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19985 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
20000 20001 20002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20000 def ReturnItemStatus.non_returnable @@_non_returnable ||= ReturnItemStatus.new('non-returnable') end |
.returnable ⇒ Object
The item in the catalog can be returned
19995 19996 19997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19995 def ReturnItemStatus.returnable @@_returnable ||= ReturnItemStatus.new('returnable') end |
Instance Method Details
#to_hash ⇒ Object
20004 20005 20006 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20004 def to_hash value end |