module SexySlug
Constants
- LOCALES
- PROCESSORS
- TRANSLATIONS
- VERSION
Public Class Methods
from(string)
click to toggle source
# File lib/sexy_slug.rb, line 7 def self.from(string) PROCESSORS.inject(string.to_s) { |str, processor| processor.call(str) } end
locale()
click to toggle source
# File lib/sexy_slug/i18n.rb, line 11 def self.locale defined?(I18n) && LOCALES.include?(I18n.locale) ? I18n.locale : :en end
t(path)
click to toggle source
# File lib/sexy_slug/i18n.rb, line 7 def self.t(path) path.split('.').inject(TRANSLATIONS[locale.to_s]) { |obj, key| obj[key] } end