class JsDuck::Warning::Deprecated

A deprecated :no_doc* warning which maps to the new :nodoc warning.

Public Class Methods

new(type, msg, nodoc, params) click to toggle source

Creates a deprecated warning with a mapping to :nodoc warning type with given parameters. The warning is disabled by default.

# File lib/jsduck/warning/deprecated.rb, line 13
def initialize(type, msg, nodoc, params)
  @type = type
  @msg = msg
  @enabled = false
  @nodoc = nodoc
  @params = params
end

Public Instance Methods

doc() click to toggle source

Documentation for the warning.

# File lib/jsduck/warning/deprecated.rb, line 33
def doc
  " -#{@type} - #{@msg} DEPRECATED"
end
enabled?(filename="", params=[]) click to toggle source

This method shouldn't be called.

# File lib/jsduck/warning/deprecated.rb, line 28
def enabled?(filename="", params=[])
  raise "Deprecated warning '#{@type}' must not be checked for enabled/disabled"
end
set(enabled, path_pattern=nil, params=[]) click to toggle source

Enables or disables the mapped :nodoc warning.

# File lib/jsduck/warning/deprecated.rb, line 22
def set(enabled, path_pattern=nil, params=[])
  @nodoc.set(enabled, path_pattern, @params)
  raise WarnException, "Warning type #{@type} is deprecated, use nodoc(#{@params.join(',')}) instead"
end