Class: ActiveRecord::Promise::Complete

Inherits:
ActiveRecord::Promise show all
Defined in:
lib/active_record/promise.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ActiveRecord::Promise

#inspect, #pretty_print

Constructor Details

#initialize(value) ⇒ Complete

Returns a new instance of Complete.



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

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#pending?Boolean

Returns:

  • (Boolean)


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

def pending?
  false
end

#thenObject



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

def then
  Complete.new(yield @value)
end