Class: JsDuck::Tag::Private

Inherits:
BooleanTag show all
Defined in:
lib/jsduck/tag/private.rb

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

Instance Attribute Summary

Attributes inherited from Tag

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

Instance Method Summary collapse

Methods inherited from BooleanTag

#parse_doc, #process_doc

Methods inherited from Tag

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

Constructor Details

#initializePrivate

Returns a new instance of Private.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/jsduck/tag/private.rb', line 5

def initialize
  @pattern = "private"
  @signature = {:long => "private", :short => "PRI"}
  @html_position = POS_PRIVATE
  @css = <<-EOCSS
    .signature .private {
      background-color: #FD6B1B; /* orange */
    }
    .private-box {
      background-color: #fee;
      text-align: center;
      color: #600;
      margin-bottom: 1em;
    }
  EOCSS
  super
end

Instance Method Details

#to_html(context) ⇒ Object

Add notice to private classes



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

def to_html(context)
  return unless context[:tagname] == :class

  return [
    "<div class='rounded-box private-box'>",
    "<p><strong>NOTE:</strong> This is a private utility class for internal use ",
    "by the framework. Don't rely on its existence.</p>",
    "</div>",
  ]
end