Class: JsDuck::Tag::Singleton

Inherits:
BooleanTag show all
Defined in:
lib/jsduck/tag/singleton.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, 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 BooleanTag

#parse_doc, #process_doc

Methods inherited from Tag

descendants, #format, #parse_doc, #process_doc, #to_html

Constructor Details

#initializeSingleton

Returns a new instance of Singleton.



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

def initialize
  @pattern = "singleton"
  @ext_define_pattern = "singleton"
  @class_icon = {
    :small => File.dirname(__FILE__) + "/icons/singleton.png",
    :large => File.dirname(__FILE__) + "/icons/singleton-large.png",
    :redirect => File.dirname(__FILE__) + "/icons/singleton-redirect.png",
    :priority => PRIORITY_SINGLETON,
  }
  @signature = {:long => "singleton", :short => "single"}
  @css = <<-EOCSS
    .signature .singleton {
      background-color: transparent;
      color: #929292;
    }
  EOCSS
  super
end

Instance Method Details

#parse_ext_define(cls, ast) ⇒ Object



24
25
26
# File 'lib/jsduck/tag/singleton.rb', line 24

def parse_ext_define(cls, ast)
  cls[:singleton] = (ast.to_value == true)
end