Class: Cms::Taggable::TagList

Inherits:
Array
  • Object
show all
Defined in:
app/models/cms/taggable.rb

Instance Method Summary collapse

Methods inherited from Array

#to_liquid

Constructor Details

#initialize(list) ⇒ TagList

Returns a new instance of TagList.



3
4
5
6
# File 'app/models/cms/taggable.rb', line 3

def initialize(list)
  list = list.is_a?(Array) ? list : list.split(/[,\W]+/).collect(&:strip).reject(&:blank?).collect(&:downcase)
  super
end

Instance Method Details

#to_sObject



8
9
10
# File 'app/models/cms/taggable.rb', line 8

def to_s
  join ', '
end