Class: IsTaggable::TagList
- Inherits:
-
Array
- Object
- Array
- IsTaggable::TagList
- Defined in:
- lib/is_taggable.rb
Constant Summary collapse
- @@delimiter =
','
Instance Method Summary collapse
-
#initialize(list) ⇒ TagList
constructor
A new instance of TagList.
- #to_s ⇒ Object
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_s ⇒ Object
16 17 18 |
# File 'lib/is_taggable.rb', line 16 def to_s join(@@delimiter) end |