Class: Io::Flow::V0::Models::ReturnStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReturnStatus
- 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 ReturnStatus for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of ReturnStatus for this value, or nil if not found.
- .open ⇒ Object
- .refunded ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ ReturnStatus
constructor
A new instance of ReturnStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ReturnStatus
Returns a new instance of ReturnStatus.
14036 14037 14038 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14036 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14034 14035 14036 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14034 def value @value end |
Class Method Details
.ALL ⇒ Object
14056 14057 14058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14056 def ReturnStatus.ALL @@all ||= [ReturnStatus.open, ReturnStatus.refunded] end |
.apply(value) ⇒ Object
Returns the instance of ReturnStatus for this value, creating a new instance for an unknown value
14041 14042 14043 14044 14045 14046 14047 14048 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14041 def ReturnStatus.apply(value) if value.instance_of?(ReturnStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ReturnStatus.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of ReturnStatus for this value, or nil if not found
14051 14052 14053 14054 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14051 def ReturnStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ReturnStatus.ALL.find { |v| v.value == value } end |
.open ⇒ Object
14060 14061 14062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14060 def ReturnStatus.open @@_open ||= ReturnStatus.new('open') end |
.refunded ⇒ Object
14064 14065 14066 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14064 def ReturnStatus.refunded @@_refunded ||= ReturnStatus.new('refunded') end |
Instance Method Details
#to_hash ⇒ Object
14068 14069 14070 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14068 def to_hash value end |