Sha256: d981f8e9849dc302dec8aa0ddfe80f9daf4aaf74f53a4febf77613b340da3785
Contents?: true
Size: 663 Bytes
Versions: 11
Compression:
Stored size: 663 Bytes
Contents
module Wally class CountsTags def initialize lists_features @lists_features = lists_features end def count_tags @lists_features.features.inject(Hash.new(0)) do |tag_count, feature| if feature["tags"] feature["tags"].each do |tag| tag_count[tag["name"].downcase] += 1 end end if feature["elements"] feature["elements"].each do |element| if element["tags"] element["tags"].each do |tag| tag_count[tag["name"].downcase] += 1 end end end end tag_count end end end end
Version data entries
11 entries across 11 versions & 1 rubygems