Class: Io::Flow::V0::Models::CaptureStatus

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) ⇒ CaptureStatus

Returns a new instance of CaptureStatus.



15628
15629
15630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15628

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15626
15627
15628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15626

def value
  @value
end

Class Method Details

.ALLObject



15648
15649
15650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15648

def CaptureStatus.ALL
  @@all ||= [CaptureStatus.pending, CaptureStatus.succeeded, CaptureStatus.failed, CaptureStatus.canceled]
end

.apply(value) ⇒ Object

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



15633
15634
15635
15636
15637
15638
15639
15640
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15633

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

.canceledObject

The capture was canceled.



15668
15669
15670
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15668

def CaptureStatus.canceled
  @@_canceled ||= CaptureStatus.new('canceled')
end

.failedObject

The capture failed to process.



15663
15664
15665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15663

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

.from_string(value) ⇒ Object

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



15643
15644
15645
15646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15643

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

.pendingObject

The capture has been initiated and requires time to complete.



15653
15654
15655
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15653

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

.succeededObject

The capture has been processed successfully.



15658
15659
15660
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15658

def CaptureStatus.succeeded
  @@_succeeded ||= CaptureStatus.new('succeeded')
end

Instance Method Details

#to_hashObject



15672
15673
15674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15672

def to_hash
  value
end