123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Promise::Complete

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveRecord::Promise
Defined in: activerecord/lib/active_record/promise.rb

Class Method Summary

Instance Attribute Summary

::ActiveRecord::Promise - Inherited

#pending?

Returns whether the associated query is still being executed or not.

Instance Method Summary

::ActiveRecord::Promise - Inherited

#then

Returns a new ::ActiveRecord::Promise that will apply the passed block when the value is accessed:

#value

Returns the query result.

#status, #inspect, #pretty_print

Constructor Details

.new(value) ⇒ Complete

[ GitHub ]

  
# File 'activerecord/lib/active_record/promise.rb', line 66

def initialize(value)
  @value = value
end

Instance Attribute Details

#pending?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/promise.rb', line 74

def pending?
  false
end

#value (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/promise.rb', line 64

attr_reader :value

Instance Method Details

#status (private)

[ GitHub ]

  
# File 'activerecord/lib/active_record/promise.rb', line 79

def status
  :complete
end

#then

[ GitHub ]

  
# File 'activerecord/lib/active_record/promise.rb', line 70

def then
  Complete.new(yield @value)
end