A library of utility services and concerns.
Provides an enumerable interface for defining a group of constants.
UserRoles = ConstantMap.new(
{
GUEST: 'guest',
USER: 'user',
ADMIN: 'admin'
}
)
UserRoles::GUEST
#=> 'guest'
UserRoles.user
#=> 'user'
UserRoles.all
#=> { :GUEST => 'guest', :USER => 'user', :ADMIN => 'admin' }
#initialize(constants) => ConstantMap
#to_h => Hash (readonly)
Also known as:
all
#each => Object
Iterates through the defined constants, yielding the name and value of each constant to the block.
#each_key => Object
Iterates through the defined constants, yielding the name of each constant to the block.
#each_pair => Object
Iterates through the defined constants, yielding the name and value of each constant to the block.
#each_value => Object
Iterates through the defined constants, yielding the value of each constant to the block.
#freeze => self
Freezes the constant map and recursively freezes every constant value.
#keys => Array
#values => Array
Back to Documentation | Reference | SleepingKingStudios | SleepingKingStudios::Tools | SleepingKingStudios::Tools::Toolbox