Skip to content

Commit 6698d68

Browse files
committed
Fix visibility
1 parent 7965d2e commit 6698d68

File tree

1 file changed

+13
-28
lines changed

1 file changed

+13
-28
lines changed

lib/concurrent/promises.rb

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def any_event_on(default_executor, *futures_and_or_events)
334334
end
335335

336336
module InternalStates
337-
# @private
337+
# @!visibility private
338338
class State
339339
def resolved?
340340
raise NotImplementedError
@@ -345,9 +345,7 @@ def to_sym
345345
end
346346
end
347347

348-
private_constant :State
349-
350-
# @private
348+
# @!visibility private
351349
class Pending < State
352350
def resolved?
353351
false
@@ -358,15 +356,11 @@ def to_sym
358356
end
359357
end
360358

361-
private_constant :Pending
362-
363-
# @private
359+
# @!visibility private
364360
class Reserved < Pending
365361
end
366362

367-
private_constant :Reserved
368-
369-
# @private
363+
# @!visibility private
370364
class ResolvedWithResult < State
371365
def resolved?
372366
true
@@ -397,9 +391,7 @@ def apply
397391
end
398392
end
399393

400-
private_constant :ResolvedWithResult
401-
402-
# @private
394+
# @!visibility private
403395
class Fulfilled < ResolvedWithResult
404396

405397
def initialize(value)
@@ -427,18 +419,14 @@ def to_sym
427419
end
428420
end
429421

430-
private_constant :Fulfilled
431-
432-
# @private
422+
# @!visibility private
433423
class FulfilledArray < Fulfilled
434424
def apply(args, block)
435425
block.call(*value, *args)
436426
end
437427
end
438428

439-
private_constant :FulfilledArray
440-
441-
# @private
429+
# @!visibility private
442430
class Rejected < ResolvedWithResult
443431
def initialize(reason)
444432
@Reason = reason
@@ -465,9 +453,7 @@ def apply(args, block)
465453
end
466454
end
467455

468-
private_constant :Rejected
469-
470-
# @private
456+
# @!visibility private
471457
class PartiallyRejected < ResolvedWithResult
472458
def initialize(value, reason)
473459
super()
@@ -496,17 +482,16 @@ def apply(args, block)
496482
end
497483
end
498484

499-
private_constant :PartiallyRejected
500-
501-
PENDING = Pending.new
485+
# @!visibility private
486+
PENDING = Pending.new
487+
# @!visibility private
502488
RESERVED = Reserved.new
489+
# @!visibility private
503490
RESOLVED = Fulfilled.new(nil)
504491

505492
def RESOLVED.to_sym
506493
:resolved
507494
end
508-
509-
private_constant :PENDING, :RESOLVED
510495
end
511496

512497
private_constant :InternalStates
@@ -1202,7 +1187,7 @@ def on_rejection_using(executor, *args, &callback)
12021187
# v < 5 ? Promises.future(v, &body) : v
12031188
# end
12041189
# Promises.future(0, &body).run.value! # => 5
1205-
def run(run_test = method(:run_test) )
1190+
def run(run_test = method(:run_test))
12061191
RunFuturePromise.new_blocked_by1(self, @DefaultExecutor, run_test).future
12071192
end
12081193

0 commit comments

Comments
 (0)