Class: Promise

Inherits:
PromiseApi show all
Defined in:
lib/bellite.rb

Overview

Class implements promise/future promise

Instance Method Summary collapse

Methods inherited from PromiseApi

#always, #done, #fail, #then, #then_

Constructor Details

#initialize(_then) ⇒ Promise

Constructing object with then-function

Parameters:

  • _then (Proc)

    Then-function



601
602
603
604
605
# File 'lib/bellite.rb', line 601

def initialize(_then) 
    if _then
        @_then = _then
    end
end

Instance Method Details

#promisePromise

Returns this object

Returns:



609
610
611
# File 'lib/bellite.rb', line 609

def promise
    return self
end