Sha256: a4266b8838e28687210275e779ee1ed74c183329e4265dbd48d5998814abbb3b
Contents?: true
Size: 445 Bytes
Versions: 10
Compression:
Stored size: 445 Bytes
Contents
module MakeTaggable ## # Returns a new TagList using the given tag string. # # Example: # tag_list = MakeTaggable::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
10 entries across 10 versions & 1 rubygems