Sha256: d86025519160aa7811e12a0b9850ce78c023b7728f1f129562b023540fbce542

Contents?: true

Size: 549 Bytes

Versions: 12

Compression:

Stored size: 549 Bytes

Contents

module JsDuck

  # Creates an array of small hashes documenting name, parent class
  # and icon of a class.
  class Icons
    def create(classes)
      classes.map do |cls|
        {
          :name => cls[:name],
          :extends => cls[:extends],
          :private => cls[:private],
          :icon => icon(cls),
        }
      end
    end

    def icon(cls)
      if cls[:singleton]
        "icon-singleton"
      elsif cls.inherits_from?("Ext.Component")
        "icon-component"
      else
        "icon-class"
      end
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
jsduck-3.5.0 lib/jsduck/icons.rb
jsduck-3.4.1 lib/jsduck/icons.rb
jsduck-3.4.0 lib/jsduck/icons.rb
jsduck-3.3.1 lib/jsduck/icons.rb
jsduck-3.3.0 lib/jsduck/icons.rb
jsduck-3.2.1 lib/jsduck/icons.rb
jsduck-3.1.0 lib/jsduck/icons.rb
jsduck-3.0.1 lib/jsduck/icons.rb
jsduck-3.0 lib/jsduck/icons.rb
jsduck-3.0.pre3 lib/jsduck/icons.rb
jsduck-3.0.pre2 lib/jsduck/icons.rb
jsduck-3.0.pre lib/jsduck/icons.rb