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.



16351
16352
16353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16351

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16349
16350
16351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16349

def value
  @value
end

Class Method Details

.ALLObject



16371
16372
16373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16371

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



16356
16357
16358
16359
16360
16361
16362
16363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16356

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.



16391
16392
16393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16391

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

.failedObject

The capture failed to process.



16386
16387
16388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16386

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



16366
16367
16368
16369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

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.



16376
16377
16378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16376

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

.succeededObject

The capture has been processed successfully.



16381
16382
16383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16381

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

Instance Method Details

#to_hashObject



16395
16396
16397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16395

def to_hash
  value
end