Class: JsDuck::Tag::Deprecated
- Defined in:
- lib/jsduck/tag/deprecated.rb
Overview
Implementation of @deprecated tag
Instance Attribute Summary
Attributes inherited from MetaTag
#assets, #boolean, #context, #formatter, #key, #multiline, #name, #position, #signature
Instance Method Summary collapse
-
#initialize ⇒ Deprecated
constructor
A new instance of Deprecated.
- #to_html(depr) ⇒ Object
- #to_value(contents) ⇒ Object
Methods inherited from MetaTag
Constructor Details
#initialize ⇒ Deprecated
Returns a new instance of Deprecated.
6 7 8 9 10 11 |
# File 'lib/jsduck/tag/deprecated.rb', line 6 def initialize @name = "deprecated" @key = :deprecated @signature = {:long => "deprecated", :short => "DEP"} @multiline = true end |
Instance Method Details
#to_html(depr) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/jsduck/tag/deprecated.rb', line 22 def to_html(depr) v = depr[:version] ? "since " + depr[:version] : "" <<-EOHTML <div class='signature-box deprecated'> <p>This #{@context[:tagname]} has been <strong>deprecated</strong> #{v}</p> #{format(depr[:text])} </div> EOHTML end |
#to_value(contents) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/jsduck/tag/deprecated.rb', line 13 def to_value(contents) text = contents[0] if text =~ /\A([0-9.]+)(.*)\Z/ {:version => $1, :text => $2.strip} else {:text => text || ""} end end |