Class: Mongoid::MinimalTags::SimpleFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid/minimal_tags/simple_formatter.rb

Overview

A very simple tag formatter using ActiveSupport's parameterize. You should create your own rather than using this.

Instance Method Summary collapse

Instance Method Details

#normalize(tags) ⇒ Array

Returns an array of normalized tags

Parameters:

  • tags (Array)

    Tags to normalize

Returns:

  • (Array)

    Unique, parameterized tags


12
13
14
# File 'lib/mongoid/minimal_tags/simple_formatter.rb', line 12

def normalize(tags)
  tags.map(&:parameterize).uniq
end