module DeferrableGratification::Bothback

Allows registering a ‘bothback’ that will be fired on either success or failure, analogous to the ensure clause of a begin/rescue block.

Include this into a class that has already included Deferrable.

Public Instance Methods

bothback(&block) click to toggle source

Register block to be called on either success or failure. This is just a shorthand for registering the same block as both a callback and an errback.

@return [Deferrable, Bothback] self

# File lib/deferrable_gratification/bothback.rb, line 12
def bothback(&block)
  callback(&block)
  errback(&block)
  self
end