Skip to content

enum Athena::Validator::Constraints::Length::Unit #

The unit used for the length check, defaulting to CODEPOINTS.

Members#

CODEPOINTS = 0#

Uses String#size to return the number of Unicode codepoints.

BYTES = 1#

Uses String#bytesize to return the number of bytes.

GRAPHEMES = 2#

Uses String#grapheme_size to return the number of Unicode graphemes clusters.

Methods#

#bytes?#

Returns true if this enum value equals BYTES

View source

#codepoints?#

Returns true if this enum value equals CODEPOINTS

View source

#graphemes?#

Returns true if this enum value equals GRAPHEMES

View source