class JsDuck::Warning::All

A composite warning, encompassing all the other warning types.

Public Class Methods

new(warnings) 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/all.rb, line 10
def initialize(warnings)
  @warnings = warnings
end

Public Instance Methods

doc() click to toggle source

The all-warning is documented separately

# File lib/jsduck/warning/all.rb, line 29
def doc
  nil
end
enabled?(filename="", params=[]) click to toggle source

Doesn't make sense to check if the :all warning is enabled.

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

Enables/disables all warnings.

# File lib/jsduck/warning/all.rb, line 15
def set(enabled, path_pattern=nil, params=[])
  # When used with a path_pattern, only add the pattern to the rules
  # where it can have an effect - otherwise we get a warning.
  @warnings.each do |w|
    w.set(enabled, path_pattern, params)
  end
end