Class: Io::Flow::V0::Models::ReversalStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ReversalStatus

Returns a new instance of ReversalStatus.



19694
19695
19696
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19694

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19692
19693
19694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19692

def value
  @value
end

Class Method Details

.ALLObject



19714
19715
19716
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19714

def ReversalStatus.ALL
  @@all ||= [ReversalStatus.pending, ReversalStatus.processed, ReversalStatus.failed]
end

.apply(value) ⇒ Object

Returns the instance of ReversalStatus for this value, creating a new instance for an unknown value



19699
19700
19701
19702
19703
19704
19705
19706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19699

def ReversalStatus.apply(value)
  if value.instance_of?(ReversalStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || ReversalStatus.new(value))
  end
end

.failedObject

Reversal failed to process.



19729
19730
19731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19729

def ReversalStatus.failed
  @@_failed ||= ReversalStatus.new('failed')
end

.from_string(value) ⇒ Object

Returns the instance of ReversalStatus for this value, or nil if not found



19709
19710
19711
19712
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19709

def ReversalStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  ReversalStatus.ALL.find { |v| v.value == value }
end

.pendingObject

Reversal is pending processing.



19719
19720
19721
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19719

def ReversalStatus.pending
  @@_pending ||= ReversalStatus.new('pending')
end

.processedObject

Reversal has been processed successfully.



19724
19725
19726
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19724

def ReversalStatus.processed
  @@_processed ||= ReversalStatus.new('processed')
end

Instance Method Details

#to_hashObject



19733
19734
19735
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19733

def to_hash
  value
end