class JsDuck::Tag::New

Public Class Methods

new() click to toggle source
Calls superclass method JsDuck::Tag::BooleanTag::new
# File lib/jsduck/tag/new.rb, line 5
    def initialize
      @pattern = "new"
      # A :tooltip field gets injected to this signature in Process::Versions
      @signature = {:long => "★", :short => "★"}
      # black (docs text color) unicode star on yellow background
      @css = <<-EOCSS
        .signature .new {
          color: #484848;
          background-color: #F5D833;
        }
      EOCSS
      super
    end

Public Instance Methods

init_tooltip!(opts) click to toggle source

Initializes the tooltip text based on the –new-since and –import options passed from command line.

NOTE: This method is explicitly called from JsDuck::Options class.

# File lib/jsduck/tag/new.rb, line 23
def init_tooltip!(opts)
  if opts.new_since
    @signature[:tooltip] = "New since #{opts.new_since}"
  elsif opts.import.length > 0
    @signature[:tooltip] = "New since #{opts.import.last[:version]}"
  end
end