Class: JsDuck::Tag::Since

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

Overview

Implementation of @since tag.

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

#initializeSince

Returns a new instance of Since.



7
8
9
10
# File 'lib/jsduck/tag/since.rb', line 7

def initialize
  @name = "since"
  @key = :since
end

Instance Method Details

#to_html(version) ⇒ Object



19
20
21
22
23
# File 'lib/jsduck/tag/since.rb', line 19

def to_html(version)
  <<-EOHTML
    <p>Available since: <b>#{version}</b></p>
  EOHTML
end

#to_value(contents) ⇒ Object



12
13
14
15
16
17
# File 'lib/jsduck/tag/since.rb', line 12

def to_value(contents)
  if contents.length > 1
    JsDuck::Logger.warn(nil, "Only one @since tag allowed per class/member.")
  end
  contents[0]
end