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:

bencoding/bencode.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

bencode(builder : Bencoding::Builder)
bencode : String
bencode

Constructor methods inherited from class Object

bdecode(io : IO) : self
bdecode(string : String) : self
bdecode

Constructor Detail

def self.new(parser : Bencoding::Parser) #

[View source]

Instance Method Detail

def bencode(builder : Bencoding::Builder) #

[View source]