Class: FriendlyId::SlugString
- Inherits:
-
Babosa::Identifier
- Object
- Babosa::Identifier
- FriendlyId::SlugString
- Defined in:
- lib/friendly_id/slug_string.rb
Instance Method Summary (collapse)
-
- (Object) normalize_for!(config)
Normalize the string for a given Configuration.
-
- (Object) validate_for!(config)
Validate that the slug string is not blank or reserved, and truncate it to the max length if necessary.
Instance Method Details
- (Object) normalize_for!(config)
Normalize the string for a given Configuration.
8 9 10 |
# File 'lib/friendly_id/slug_string.rb', line 8 def normalize_for!(config) normalize!(config.) end |
- (Object) validate_for!(config)
Validate that the slug string is not blank or reserved, and truncate it to the max length if necessary.
18 19 20 21 22 23 |
# File 'lib/friendly_id/slug_string.rb', line 18 def validate_for!(config) truncate_bytes!(config.max_length) raise FriendlyId::BlankError if empty? raise FriendlyId::ReservedError if config.reserved?(self) self end |