Class: ActiveRecord::FutureResult::Complete

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/future_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Complete

Returns a new instance of Complete.



9
10
11
# File 'activerecord/lib/active_record/future_result.rb', line 9

def initialize(result)
  @result = result
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result



6
7
8
# File 'activerecord/lib/active_record/future_result.rb', line 6

def result
  @result
end

Instance Method Details

#canceled?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'activerecord/lib/active_record/future_result.rb', line 17

def canceled?
  false
end

#pending?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'activerecord/lib/active_record/future_result.rb', line 13

def pending?
  false
end

#then(&block) ⇒ Object



21
22
23
# File 'activerecord/lib/active_record/future_result.rb', line 21

def then(&block)
  Promise::Complete.new(@result.then(&block))
end