Sha256: 8e3dc06b091f67cbc5dbe90b47612455f210eb39265cbebe844139227eecdf76

Contents?: true

Size: 344 Bytes

Versions: 2

Compression:

Stored size: 344 Bytes

Contents

module HasMachineTags
  class TagList < Array #:nodoc:
    cattr_accessor :delimiter
    self.delimiter = ','
  
    def initialize(string_or_array)
      array = string_or_array.is_a?(Array) ? string_or_array : string_or_array.split(/\s*#{delimiter}\s*/)
      concat array
    end
  
    def to_s
      join("#{delimiter} ")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cldwalker-has_machine_tags-0.1.2 lib/has_machine_tags/tag_list.rb
cldwalker-has_machine_tags-0.1.3 lib/has_machine_tags/tag_list.rb