Skip to content

Commit 9980c69

Browse files
committed
📚 Workaround rdoc method visibility bug
Apparently rdoc doesn't recognize the visibility modifiers when they are used with method def arguments? 🙁
1 parent ba0f695 commit 9980c69

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

lib/net/imap/sequence_set.rb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -927,14 +927,18 @@ def each_element # :yields: integer or range or :*
927927
self
928928
end
929929

930-
private def tuple_to_entry((min, max))
930+
private
931+
932+
def tuple_to_entry((min, max))
931933
if min == STAR_INT then :*
932934
elsif max == STAR_INT then min..
933935
elsif min == max then min
934936
else min..max
935937
end
936938
end
937939

940+
public
941+
938942
# Yields each range in #ranges to the block and returns self.
939943
# Returns an enumerator when called without a block.
940944
#
@@ -1002,7 +1006,9 @@ def find_index(number)
10021006
nil
10031007
end
10041008

1005-
private def each_tuple_with_index
1009+
private
1010+
1011+
def each_tuple_with_index
10061012
idx_min = 0
10071013
@tuples.each do |min, max|
10081014
yield min, max, idx_min, (idx_max = idx_min + (max - min))
@@ -1011,7 +1017,7 @@ def find_index(number)
10111017
idx_min
10121018
end
10131019

1014-
private def reverse_each_tuple_with_index
1020+
def reverse_each_tuple_with_index
10151021
idx_max = -1
10161022
@tuples.reverse_each do |min, max|
10171023
yield min, max, (idx_min = idx_max - (max - min)), idx_max
@@ -1020,6 +1026,8 @@ def find_index(number)
10201026
idx_max
10211027
end
10221028

1029+
public
1030+
10231031
# :call-seq: at(index) -> integer or nil
10241032
#
10251033
# Returns a number from +self+, without modifying the set. Behaves the
@@ -1086,15 +1094,17 @@ def [](index, length = nil)
10861094

10871095
alias slice :[]
10881096

1089-
private def slice_length(start, length)
1097+
private
1098+
1099+
def slice_length(start, length)
10901100
start = Integer(start.to_int)
10911101
length = Integer(length.to_int)
10921102
raise ArgumentError, "length must be positive" unless length.positive?
10931103
last = start + length - 1 unless start.negative? && start.abs <= length
10941104
slice_range(start..last)
10951105
end
10961106

1097-
private def slice_range(range)
1107+
def slice_range(range)
10981108
first = range.begin || 0
10991109
last = range.end || -1
11001110
last -= 1 if range.exclude_end? && range.end && last != STAR_INT
@@ -1109,6 +1119,8 @@ def [](index, length = nil)
11091119
end
11101120
end
11111121

1122+
public
1123+
11121124
# Returns a frozen SequenceSet with <tt>*</tt> converted to +max+, numbers
11131125
# and ranges over +max+ removed, and ranges containing +max+ converted to
11141126
# end at +max+.

0 commit comments

Comments
 (0)