Class: Nitpick::Nitpicker

Class | Nitpick::Nitpicker
In: | lib/nitpick/nitpicker.rb
Parent: | SexpProcessor

### Methods

new nitpick! process_cfunc process_defn scan_for warn

### Attributes

warnings | [RW] |

### Public Class methods

new(klass, meth)

[Source]

    # File lib/nitpick/nitpicker.rb, line 5
        def initialize(klass, meth)
          super()
          self.auto_shift_type = true
          self.strict = false
          self.expected = Sexp

          @unsupported.delete(:cfunc)
          @class = klass
          @method = meth
          @warnings = []
        end

### Public Instance methods

nitpick!()

[Source]

    # File lib/nitpick/nitpicker.rb, line 17
        def nitpick!
          process(ParseTree.translate(@class, @method))
        end

process_cfunc(exp)

[Source]

    # File lib/nitpick/nitpicker.rb, line 44
        def process_cfunc(exp); exp.clear; s(); end

process_defn(exp)

[Source]

    # File lib/nitpick/nitpicker.rb, line 33
        def process_defn(exp)
          method = exp.shift
          result = s(:defn, method)

          until exp.empty?
            result << process(exp.shift)
          end

          result
        end

scan_for(warning_classes, options = {})

[Source]

    # File lib/nitpick/nitpicker.rb, line 21
        def scan_for(warning_classes, options = {})
          matched_warnings = warning_classes.map do |warning_class|
            warning_class.discover(options[:with])
          end

          warn(*matched_warnings)
        end

warn(*warnings)

[Source]

    # File lib/nitpick/nitpicker.rb, line 29
        def warn(*warnings)
          @warnings += warnings.compact
        end

[Validate]