Sha256: 64b944109dd8373155f4d6e778719f8f0e32a7eaa7178e8937e04644dd0b2e1d

Contents?: true

Size: 623 Bytes

Versions: 23

Compression:

Stored size: 623 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 => Icons::class_icon(cls),
        }
      end
    end

    # Returns CSS class name for an icon of class
    def self.class_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

23 entries across 23 versions & 1 rubygems

Version Path
jsduck-4.10.4 lib/jsduck/icons.rb
jsduck-4.10.3 lib/jsduck/icons.rb
jsduck-4.10.2 lib/jsduck/icons.rb
jsduck-4.10.1 lib/jsduck/icons.rb
jsduck-4.10.0 lib/jsduck/icons.rb
jsduck-4.9.0 lib/jsduck/icons.rb
jsduck-4.8.0 lib/jsduck/icons.rb
jsduck-4.7.1 lib/jsduck/icons.rb
jsduck-4.7.0 lib/jsduck/icons.rb
jsduck-5.0.0.beta01 lib/jsduck/icons.rb
jsduck-4.6.2 lib/jsduck/icons.rb
jsduck-4.6.1 lib/jsduck/icons.rb
jsduck-4.6.0 lib/jsduck/icons.rb
jsduck-4.5.1 lib/jsduck/icons.rb
jsduck-4.5.0 lib/jsduck/icons.rb
jsduck-4.4.1 lib/jsduck/icons.rb
jsduck-4.4.0 lib/jsduck/icons.rb
jsduck-4.3.2 lib/jsduck/icons.rb
jsduck-4.3.1 lib/jsduck/icons.rb
jsduck-4.3.0 lib/jsduck/icons.rb