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.
9416 9417 9418 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9416 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9414 9415 9416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9414 def value @value end |
Class Method Details
.ALL ⇒ Object
9436 9437 9438 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9436 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
9421 9422 9423 9424 9425 9426 9427 9428 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9421 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
9431 9432 9433 9434 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9431 def ReturnStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ReturnStatus.ALL.find { |v| v.value == value } end |
.open ⇒ Object
9440 9441 9442 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9440 def ReturnStatus.open @@_open ||= ReturnStatus.new('open') end |
.refunded ⇒ Object
9444 9445 9446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9444 def ReturnStatus.refunded @@_refunded ||= ReturnStatus.new('refunded') end |
Instance Method Details
#to_hash ⇒ Object
9448 9449 9450 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9448 def to_hash value end |