Class: JsDuck::Tag::Default

Inherits:
Tag
  • Object
show all
Defined in:
lib/jsduck/tag/default.rb

Overview

There is no @default tag.

Default values are detected from syntax like this:

@cfg [blah=somedefault]

This tag class exists to generate the “Defaults to:” text in final HTML.

Constant Summary

Constants inherited from Tag

Tag::POS_ASIDE, Tag::POS_DEFAULT, Tag::POS_DEPRECATED, Tag::POS_DOC, Tag::POS_ENUM, Tag::POS_FIRES, Tag::POS_LOCALDOC, Tag::POS_OVERRIDES, Tag::POS_PARAM, Tag::POS_PREVENTABLE, Tag::POS_PRIVATE, Tag::POS_RETURN, Tag::POS_SINCE, Tag::POS_SUBPROPERTIES, Tag::POS_TEMPLATE, Tag::POS_THROWS, Tag::PRIORITY_CLASS, Tag::PRIORITY_COMPONENT, Tag::PRIORITY_SINGLETON

Instance Attribute Summary

Attributes inherited from Tag

#class_icon, #css, #ext_define_default, #ext_define_pattern, #html_position, #pattern, #repeatable, #signature, #tagname

Instance Method Summary collapse

Methods inherited from Tag

descendants, #format, #parse_doc, #parse_ext_define, #process_doc

Constructor Details

#initializeDefault

Returns a new instance of Default.



14
15
16
17
# File 'lib/jsduck/tag/default.rb', line 14

def initialize
  @tagname = :default
  @html_position = POS_DEFAULT
end

Instance Method Details

#to_html(m) ⇒ Object



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

def to_html(m)
  return if m[:default] == "undefined"

  "<p>Defaults to: <code>" + JsDuck::Util::HTML.escape(m[:default]) + "</code></p>"
end