Skip to content

Commit

Permalink
add docs to SortedSet
Browse files Browse the repository at this point in the history
  • Loading branch information
GarrisonJ committed May 30, 2024
1 parent fcf9d9f commit dfd40d2
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion lib/sorted_containers/sorted_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,29 @@
module SortedContainers
# rubocop:disable Metrics/ClassLength

# The SortedSet class is a sorted set implementation.
# SortedSet is a set that maintains its elements in sorted order.
#
# SortedSet has most of the same methods as Set, but also has the following
# additional methods:
# - #bisect_left
# - #bisect_right
# - #delete_at
# - #last
# - #[]
#
# Addtionally, there are methods that work differently than their Set counterparts.
# Generally, methods that use Entry Order will use the sort order of the keys instead.
# For example:
#
# s = Set.new
# s.add(2)
# s.add(1)
# s.first # => 2
#
# ss = SortedSet.new
# ss.add(2)
# ss.add(1)
# ss.first # => 1
class SortedSet
include Enumerable
extend Forwardable
Expand Down

0 comments on commit dfd40d2

Please sign in to comment.