struct

Prostore::Schema::EnumMember

Inherits Struct < Value < Object

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 for enum_string columns and that appears in the CHECK constraint (ADR-0017). Defaults to name for backward compatibility with declarations that don't opt into a custom naming convention (naming: :as_declared). For enum_int columns the wire form is the integer value, but the field still travels through this record so the bookkeeping table is uniform.

Constructors

new(name : String, value : Int64, wire_name : String = "")
Source

Instance methods

clone
Source
copy_with(name _name = @name, value _value = @value, wire_name _wire_name = @wire_name)
Source
name
value
wire_name

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.

Source