class Marten::Template::Object::Enum
- Marten::Template::Object::Enum
- Reference
- Object
Overview
Allows to expose enum values in templates contexts.
This class serves as a "wrapper" for a real enum value, containing both its "value" and "name". It enables smooth manipulation of such enum values within a template runtime. Ordinary enum values cannot be used directly in templates because Enum be added to union types, hence why this class is necessary.
Included Modules
Defined in:
marten/template/object/enum.crConstructors
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #enum_class_name : String
- #enum_value_names : Array(String)
- #name : String
- #value : Int64
Macros inherited from module Marten::Template::Object
template_attributes(*names)
template_attributes
Constructor Detail
def self.new(enum_class_name : String, enum_value_names : Array(String), name : String, value : Int64)
#
Instance Method Detail
def ==(other : self)
#
Description copied from class Reference
Returns true
if this reference is the same as other. Invokes same?
.