Class Nitpick::Warnings::UnprotectedBlock
In: lib/nitpick/warnings/unprotected_block.rb
Parent: SimpleWarning

Methods

==   matches?   message   new  

Attributes

condition  [R] 
no_branch  [R] 
yes_branch  [R] 

Public Class methods

[Source]

# File lib/nitpick/warnings/unprotected_block.rb, line 6
      def initialize(*args)
        @condition, @yes_branch, @no_branch = args
      end

Public Instance methods

[Source]

# File lib/nitpick/warnings/unprotected_block.rb, line 15
      def ==(other)
        yes_branch == other.yes_branch && no_branch == other.no_branch
      end

[Source]

# File lib/nitpick/warnings/unprotected_block.rb, line 10
      def matches?
        # raise "YES: #{yes_branch.inspect}"
        yes_branch =~ s(:yield) && condition !~ s(:fcall, :block_given?)
      end

[Source]

# File lib/nitpick/warnings/unprotected_block.rb, line 19
      def message
        "A block is being yielded to without a check for block_given?"
      end

[Validate]