Sha256: dbe5f8b2d466960c8c2238d5c961182058673e88a0f1197e4986b7111f951b04
Contents?: true
Size: 453 Bytes
Versions: 17
Compression:
Stored size: 453 Bytes
Contents
module ActsAsTaggableOn ## # Returns a new TagList using the given tag string. # # Example: # tag_list = ActsAsTaggableOn::GenericParser.new.parse("One , Two, Three") # tag_list # ["One", "Two", "Three"] class GenericParser def initialize(tag_list) @tag_list = tag_list end def parse TagList.new.tap do |tag_list| tag_list.add @tag_list.split(',').map(&:strip).reject(&:empty?) end end end end
Version data entries
17 entries across 17 versions & 3 rubygems