Sha256: 14ab0f3ae0c86c848a346be4356cebcd7f737e4f279e21ce4827c700c5b64e8f

Contents?: true

Size: 399 Bytes

Versions: 7

Compression:

Stored size: 399 Bytes

Contents

module JsDuck

  # Takes the structure produced by JsDuck::Tree.create and creates
  # hashmap of classname-icon pairs.
  class TreeIcons
    def extract_icons(node)
      icons = {}
      if node[:children]
        node[:children].each do |child|
          icons.merge!(extract_icons(child))
        end
      else
        icons[node[:id]] = node[:iconCls]
      end
      icons
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jsduck-0.6.1 lib/jsduck/tree_icons.rb
jsduck-0.6 lib/jsduck/tree_icons.rb
jsduck-0.5 lib/jsduck/tree_icons.rb
jsduck-0.4 lib/jsduck/tree_icons.rb
jsduck-0.3 lib/jsduck/tree_icons.rb
jsduck-0.2 lib/jsduck/tree_icons.rb
jsduck-0.1 lib/jsduck/tree_icons.rb