Class: Nitpick::Warnings::UnprotectedBlock

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

new(*args)

[Source]

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

### Public Instance methods

==(other)

[Source]

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

matches?()

[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

message()

[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]