File tree 1 file changed +7
-0
lines changed 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -571,6 +571,8 @@ def disjoint?(other)
571
571
#
572
572
# Returns the maximum value in +self+, +star+ when the set includes
573
573
# <tt>*</tt>, or +nil+ when the set is empty.
574
+ #
575
+ # Related: #min, #minmax
574
576
def max(star: :*)
575
577
(val = @tuples.last&.last) && val == STAR_INT ? star : val
576
578
end
@@ -581,12 +583,16 @@ def max(star: :*)
581
583
# set is <tt>*</tt>, or +nil+ when the set is empty.
582
584
def min(star: :*)
583
585
(val = @tuples.first&.first) && val == STAR_INT ? star : val
586
+ #
587
+ # Related: #max, #minmax
584
588
end
585
589
586
590
# :call-seq: minmax(star: :*) => nil or [integer, integer or star]
587
591
#
588
592
# Returns a 2-element array containing the minimum and maximum numbers in
589
593
# +self+, or +nil+ when the set is empty.
594
+ #
595
+ # Related: #min, #max
590
596
def minmax(star: :*); [min(star: star), max(star: star)] unless empty? end
591
597
592
598
# Returns false when the set is empty.
@@ -1276,6 +1282,7 @@ def slice_range(range)
1276
1282
# Net::IMAP::SequenceSet["500:*"].limit(max: 37)
1277
1283
# #=> Net::IMAP::SequenceSet["37"]
1278
1284
#
1285
+ # Related: #limit!
1279
1286
def limit(max:)
1280
1287
max = to_tuple_int(max)
1281
1288
if empty? then self.class.empty
You can’t perform that action at this time.
0 commit comments