Class: IsTaggable::TagList

Inherits:
Array
  • Object
show all
Defined in:
lib/is_taggable.rb

Constant Summary collapse

@@delimiter =
','

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ TagList

Returns a new instance of TagList.


11
12
13
14
# File 'lib/is_taggable.rb', line 11

def initialize(list)
  list = list.is_a?(Array) ? list : list.split(@@delimiter).collect(&:strip).reject(&:blank?)
  super
end

Instance Method Details

#to_sObject


16
17
18
# File 'lib/is_taggable.rb', line 16

def to_s
  join(@@delimiter)
end