class String

Public Instance Methods

parse_friendly_id(separator = nil) click to toggle source
# File lib/friendly_id.rb, line 62
def parse_friendly_id(separator = nil)
  separator ||= FriendlyId::Configuration::DEFAULTS[:sequence_separator]
  name, sequence = split(/#{Regexp.escape(separator)}(\d+)?\z/)
  return name, sequence ||= "1"
end