Module: HappySlugs

Defined in:
lib/happy_slugs.rb,
lib/happy_slugs/words.rb,
lib/happy_slugs/version.rb

Defined Under Namespace

Modules: SlugGenerator, Words Classes: ExhaustedError

Constant Summary collapse

DEFAULT_PATTERN =
i[adjective noun verb].freeze
BATCH_SIZE =
10
VERSION =
"0.1.0"

Instance Method Summary collapse

Instance Method Details

#has_happy_slugs(attribute = :slug, pattern: DEFAULT_PATTERN, separator: "-", suffix_length: 4) ⇒ Object



77
78
79
80
81
82
83
84
# File 'lib/happy_slugs.rb', line 77

def has_happy_slugs(attribute = :slug, pattern: DEFAULT_PATTERN, separator: "-", suffix_length: 4)
  class_attribute :happy_slug_attribute, default: attribute
  class_attribute :happy_slug_pattern, default: pattern
  class_attribute :happy_slug_separator, default: separator
  class_attribute :happy_slug_suffix_length, default: suffix_length

  include SlugGenerator
end