Class: JsDuck::Tag::Removed

Inherits:
MetaTag
  • Object
show all
Defined in:
lib/jsduck/tag/removed.rb

Overview

Implementation of @removed tag.

To document members that were present in previous version but are completely gone now. Other than that it behaves exactly like @deprecated.

Instance Attribute Summary

Attributes inherited from MetaTag

#assets, #boolean, #context, #formatter, #key, #multiline, #name, #position, #signature

Instance Method Summary collapse

Methods inherited from MetaTag

descendants, #format

Constructor Details

#initializeRemoved

Returns a new instance of Removed.



9
10
11
12
13
14
# File 'lib/jsduck/tag/removed.rb', line 9

def initialize
  @name = "removed"
  @key = :removed
  @signature = {:long => "removed", :short => "REM"}
  @multiline = true
end

Instance Method Details

#to_html(val) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/jsduck/tag/removed.rb', line 25

def to_html(val)
  ver = val[:version] ? "since " + val[:version] : ""
  <<-EOHTML
    <div class='signature-box removed'>
    <p>This #{@context[:tagname]} has been <strong>removed</strong> #{ver}</p>
    #{format(val[:text])}
    </div>
  EOHTML
end

#to_value(contents) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/jsduck/tag/removed.rb', line 16

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