Class: FriendlyId::SlugString
- Defined in:
- lib/friendly_id/slug_string.rb
Instance Method Summary collapse
-
#normalize_for!(config) ⇒ Object
Normalize the string for a given Configuration.
-
#validate_for!(config) ⇒ Object
Validate that the slug string is not blank or reserved, and truncate it to the max length if necessary.
Instance Method Details
#normalize_for!(config) ⇒ Object
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 |
#validate_for!(config) ⇒ Object
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 |