Archive

Category Archives for "Coding Packets Blog"

Crystal Notes: Enums

Enums group a related number of values and store the values internally as integers. Enums are good to use when the number of values are not too big. Considerations Enums are a type safe alternative to Symbols. It is recommended to use Enums whenever possible and only use Symbols for an...continue reading

Crystal Notes: Hashes

Hashes in Crystal are a collection of key/value pairs of defined types. Creating a hash # Deduce the type signature of a hash. typeof(stuff_and_things) # => Hash(String, String) # To create an empty hash, you must define # the intended type of its key/value pairs. # There are 2 ways to define...continue reading

1 6 7 8 9 10 29