abstract struct MultiArrayUtils::RTEnum

Overview

"enum" with list of values filled at runtime. Mimics Enum as a MultiArray index: has #values to iterate and #new Can be filled with list of strings or count of values:

struct Stations < RTEnum
end

Stations.set_names("Station1", "Station2", "Station3")
# alternatively,
# Stations.set_count(15)

v1 = Stations.new(0)
v2 = Stations.new("Station1")
v1.should eq v2

Defined in:

utils.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(other : self) #

[View source]
def self.new(value : String) #

[View source]
def self.new(raw : Int32, *, dont_check = false) #

[View source]

Class Method Detail

def self.set_names(names, *, dont_lock = false) #

[View source]
def self.set_size(count, dont_lock = false) #

[View source]
def self.values #

[View source]

Instance Method Detail

def inspect(io) #

[View source]
def to_i : Int32 #

[View source]
def to_s(io) #

[View source]