Module: Wool::Advice::CommentAdvice

Included in:
OperatorSpacing
Defined in:
lib/wool/advice/comment_advice.rb

Overview

Using this module, you can make your match? method automatically receive de-commented source text.

class MyWarning < Wool::Warning do

extend Wool::Advice::CommentAdvice

def self.match?(body, context)
  body.include?('#')
end
remove_comments

end

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



15
16
17
18
# File 'lib/wool/advice/comment_advice.rb', line 15

def self.included(klass)
  klass.__send__(:extend, ClassMethods)
  klass.__send__(:include, InstanceMethods)
end