Class: Order::AuthorizationSplitter::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/order/authorization_splitter.rb

Overview

Outcome of a split attempt.
:split - payment was allocated and the child is now fully funded
:noop - nothing to do (no deliveries, or the parent has no auth to split)
:failed - a payment path ran but the child is still underfunded

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status: :noop) ⇒ Result

Returns a new instance of Result.



32
# File 'app/services/order/authorization_splitter.rb', line 32

def initialize(status: :noop) = super

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



27
28
29
# File 'app/services/order/authorization_splitter.rb', line 27

def status
  @status
end

Class Method Details

.failedObject



30
# File 'app/services/order/authorization_splitter.rb', line 30

def self.failed = new(status: :failed)

.noopObject



29
# File 'app/services/order/authorization_splitter.rb', line 29

def self.noop   = new(status: :noop)

.splitObject



28
# File 'app/services/order/authorization_splitter.rb', line 28

def self.split  = new(status: :split)

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


36
# File 'app/services/order/authorization_splitter.rb', line 36

def failed? = status == :failed

#noop?Boolean

Returns:

  • (Boolean)


35
# File 'app/services/order/authorization_splitter.rb', line 35

def noop?   = status == :noop

#split?Boolean

Returns:

  • (Boolean)


34
# File 'app/services/order/authorization_splitter.rb', line 34

def split?  = status == :split