struct
Prostore::Schema::EnumMember
- Prostore::Schema::EnumMember
- Struct
- Value
- Object
Overview
A single Crystal enum member captured from a field declaration whose
type resolves to an Enum subclass (ADR-0016, ADR-0017). Each member
carries:
#name— the source-level Crystal identifier (BounceHard), used for display, error messages, and as the lookup key when comparing schemas across migrations.#value— the underlying Int64-promoted integer value, used for the int-backed wire form and@[Flags]arithmetic.#wire_name— the string that hits the database forenum_stringcolumns and that appears in the CHECK constraint (ADR-0017). Defaults to#namefor backward compatibility with declarations that don't opt into a custom naming convention (naming: :as_declared). Forenum_intcolumns the wire form is the integer value, but the field still travels through this record so the bookkeeping table is uniform.
Defined in:
prostore/schema/enum_member.cr:20prostore/schema/enum_member.cr:25
Constructors
Instance Method Summary
- #clone
- #copy_with(name _name = @name, value _value = @value, wire_name _wire_name = @wire_name)
- #name : String
- #value : Int64
-
#wire_name : String
When constructed without an explicit wire_name, fall back to the source-level name so existing call sites and bookkeeping rows that predate ADR-0017 stay valid.
Constructor Detail
Instance Method Detail
def copy_with(name _name = @name, value _value = @value, wire_name _wire_name = @wire_name)
#
def wire_name : String
#
When constructed without an explicit wire_name, fall back to the source-level name so existing call sites and bookkeeping rows that predate ADR-0017 stay valid.