Class: JsDuck::Format::Class
- Inherits:
-
Object
- Object
- JsDuck::Format::Class
- Defined in:
- lib/jsduck/format/class.rb
Overview
Performs documentation formatting of a class and all of its members.
The actual work is delegated to the #format methods of Tag classes, to which we pass the Format::Doc instance which they can use to perform the formatting.
The formatting done by #format methods usually consists of turning :doc properties of class from markdown to HTML, resolving @links, and converting type definitions to HTML.
Instance Method Summary collapse
-
#format(cls) ⇒ Object
Runs the formatter on doc object of a class.
-
#images ⇒ Object
Access to the Img::DirSet object inside doc-formatter.
-
#initialize(formatter) ⇒ Class
constructor
A new instance of Class.
Constructor Details
#initialize(formatter) ⇒ Class
Returns a new instance of Class.
17 18 19 |
# File 'lib/jsduck/format/class.rb', line 17 def initialize(formatter) @formatter = formatter end |
Instance Method Details
#format(cls) ⇒ Object
Runs the formatter on doc object of a class. Accessed using Class#internal_doc
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/jsduck/format/class.rb', line 23 def format(cls) @formatter.class_context = cls[:name] @formatter.doc_context = cls[:files][0] (cls) # format all members (except hidden ones) cls[:members].each {|m| format_member(m) unless m[:hide] } cls end |
#images ⇒ Object
Access to the Img::DirSet object inside doc-formatter
36 37 38 |
# File 'lib/jsduck/format/class.rb', line 36 def images @formatter.images end |