Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions core/set.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,15 @@ class Set[unchecked out A]
#
def compare_by_identity: () -> self

# <!--
# rdoc-file=lib/set.rb
# - compare_by_identity?()
# -->
# Returns true if the set will compare its elements by their
# identity. Also see Set#compare_by_identity.
#
def compare_by_identity?: () -> bool

# <!--
# rdoc-file=lib/set.rb
# - disjoint?(set)
Expand Down Expand Up @@ -477,6 +486,15 @@ class Set[unchecked out A]
#
def flatten: () -> Set[untyped]

# <!--
# rdoc-file=lib/set.rb
# - flatten!()
# -->
# Equivalent to Set#flatten, but replaces the receiver with the
# result in place. Returns nil if no modifications were made.
#
def flatten!: () -> self?

# <!--
# rdoc-file=lib/set.rb
# - intersect?(set)
Expand Down Expand Up @@ -532,6 +550,13 @@ class Set[unchecked out A]
#
def subset?: (self) -> bool

# <!--
# rdoc-file=lib/set.rb
# - <=(set)
# -->
#
alias <= subset?

# <!--
# rdoc-file=lib/set.rb
# - proper_subset?(set)
Expand All @@ -540,6 +565,13 @@ class Set[unchecked out A]
#
def proper_subset?: (self) -> bool

# <!--
# rdoc-file=lib/set.rb
# - <(set)
# -->
#
alias < proper_subset?

# <!--
# rdoc-file=lib/set.rb
# - superset?(set)
Expand All @@ -548,6 +580,13 @@ class Set[unchecked out A]
#
def superset?: (self) -> bool

# <!--
# rdoc-file=lib/set.rb
# - >=(set)
# -->
#
alias >= superset?

# <!--
# rdoc-file=lib/set.rb
# - proper_superset?(set)
Expand All @@ -556,6 +595,13 @@ class Set[unchecked out A]
#
def proper_superset?: (self) -> bool

# <!--
# rdoc-file=lib/set.rb
# - >(set)
# -->
#
alias > proper_superset?

# <!--
# rdoc-file=lib/set.rb
# - replace(enum)
Expand Down Expand Up @@ -587,6 +633,11 @@ class Set[unchecked out A]
#
def select!: () { (A) -> untyped } -> self?

# <!-- rdoc-file=lib/set.rb -->
# Equivalent to Set#select!
#
alias filter! select!

# <!--
# rdoc-file=lib/set.rb
# - subtract(enum)
Expand All @@ -605,6 +656,15 @@ class Set[unchecked out A]
# Set[1, 'c', :s].to_a #=> [1, "c", :s]
#
def to_a: () -> Array[A]

# <!--
# rdoc-file=lib/set.rb
# - join(separator=nil)
# -->
# Returns a string created by converting each element of the set to a string
# See also: Array#join
#
def join: (?string separator) -> String
end

%a{annotate:rdoc:skip}
Expand Down