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:

strict-yaml/objects.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

to_yaml(io : IO) : Nil
to_yaml : String
to_yaml

Class methods inherited from class Object

from_yaml(source : String)
from_yaml(value : StrictYAML::Any)
from_yaml

Constructor Detail

def self.new(value : StrictYAML::Any) #

[View source]

Instance Method Detail

def to_yaml(yaml : StrictYAML::Builder) : Nil #

[View source]