Sha256: 2c1856ec96d37f4d3bd008557de537e582dee8d15b41c7758e72d4212e713386

Contents?: true

Size: 768 Bytes

Versions: 4

Compression:

Stored size: 768 Bytes

Contents

require "jsduck/meta_tag"

module JsDuck::Tag
  # Implementation of @deprecated tag
  class Deprecated < JsDuck::MetaTag
    def initialize
      @name = "deprecated"
      @key = :deprecated
      @signature = {:long => "deprecated", :short => "DEP"}
      @multiline = true
    end

    def to_value(contents)
      text = contents[0]
      if text =~ /\A([0-9.]+)(.*)\Z/
        {:version => $1, :text => $2.strip}
      else
        {:text => text || ""}
      end
    end

    def to_html(depr)
      v = depr[:version] ? "since " + depr[:version] : ""
      <<-EOHTML
        <div class='signature-box deprecated'>
        <p>This member has been <strong>deprecated</strong> #{v}</p>
        #{format(depr[:text])}
        </div>
      EOHTML
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jsduck-3.4.0 lib/jsduck/tag/deprecated.rb
jsduck-3.3.1 lib/jsduck/tag/deprecated.rb
jsduck-3.3.0 lib/jsduck/tag/deprecated.rb
jsduck-3.2.1 lib/jsduck/tag/deprecated.rb