Method: JsDuck::Format::Subproperties#format

Defined in:
lib/jsduck/format/subproperties.rb

#format(item) ⇒ Object

Takes a hash of param, return value, throws value or subproperty.

  • Markdown-formats the :doc field in it.

  • Parses the :type field and saves HTML to :html_type.

  • Recursively does the same with all items in :properties field.



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/jsduck/format/subproperties.rb', line 26

def format(item)
  item[:doc] = @formatter.format(item[:doc]) if item[:doc]

  if item[:type]
    item[:html_type] = format_type(item[:type])
  end

  if item[:properties]
    item[:properties].each {|p| format(p) }
  end
end