Sha256: 7d66b660efaa014f4ad53f93ea23cc7083455a667449503e04993faf8c2f05f7
Contents?: true
Size: 763 Bytes
Versions: 22
Compression:
Stored size: 763 Bytes
Contents
# encoding: utf-8 module FriendlyId class SlugString < Babosa::Identifier # Normalize the string for a given {FriendlyId::Configuration}. # @param config [FriendlyId::Configuration] # @return String def normalize_for!(config) normalize!(config.babosa_options) end # Validate that the slug string is not blank or reserved, and truncate # it to the max length if necessary. # @param config [FriendlyId::Configuration] # @return String # @raise FriendlyId::BlankError # @raise FriendlyId::ReservedError def validate_for!(config) truncate_bytes!(config.max_length) raise FriendlyId::BlankError if empty? raise FriendlyId::ReservedError if config.reserved?(self) self end end end
Version data entries
22 entries across 22 versions & 2 rubygems