struct Set(T)

Overview

Set implements a collection of unordered values with no duplicates.

An Enumerable object can be converted to Set using the #to_set method.

Set uses Hash as storage, so you must note the following points:

Example

s1 = Set{1, 2}
s2 = [1, 2].to_set
s3 = Set.new [1, 2]
s1 == s2 # => true
s1 == s3 # => true
s1.add(2)
s1.concat([6, 8])
s1.subset_of? s2 # => false
s2.subset_of? s1 # => true

Included Modules

Defined in:

to_xml.cr

Instance Method Summary

Instance methods inherited from class Object

to_xml(builder : XML::Builder) : Nil
to_xml(io : IO, *, root : String | Nil, indent : String) : Nil
to_xml(*, root : String = "root", indent : String = " ") : String
to_xml

Instance Method Detail

def to_xml(builder : XML::Builder, key : String | Nil = nil) : Nil #

[View source]