Class: Nitpick::Warnings::AssignmentAsCondition

Class | Nitpick::Warnings::AssignmentAsCondition
In: | lib/nitpick/warnings/assignment_as_condition.rb
Parent: | SimpleWarning

### Methods

matches? message new

### Constants

ASSIGNMENT_NODES | = | [:lasgn, :op_asgn_or, :op_asgn_and, :iasgn, :op_asgn1, :gasgn, :dasgn_curr]

### Attributes

condition | [R] |

### Public Class methods

new(*args)

[Source]

    # File lib/nitpick/warnings/assignment_as_condition.rb, line 9
          def initialize(*args)
            @condition = args.shift
          end

### Public Instance methods

matches?()

[Source]

    # File lib/nitpick/warnings/assignment_as_condition.rb, line 13
          def matches?
            ASSIGNMENT_NODES.include? @condition.first
          end

message()

[Source]

    # File lib/nitpick/warnings/assignment_as_condition.rb, line 17
          def message
            "An assigment is being used as a condition: (#{sexp_to_ruby(@condition)})"
          end

[Validate]