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
10428 10429 10430 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10428 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10426 10427 10428 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10426 def value @value end |
Class Method Details
.ALL ⇒ Object
10448 10449 10450 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10448 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
10433 10434 10435 10436 10437 10438 10439 10440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10433 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
10443 10444 10445 10446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10443 def ReturnStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ReturnStatus.ALL.find { |v| v.value == value } end |
.open ⇒ Object
10452 10453 10454 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10452 def ReturnStatus.open @@_open ||= ReturnStatus.new('open') end |
.refunded ⇒ Object
10456 10457 10458 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10456 def ReturnStatus.refunded @@_refunded ||= ReturnStatus.new('refunded') end |
Instance Method Details
#to_hash ⇒ Object
10460 10461 10462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10460 def to_hash value end |