Class Nitpick::Warnings::IdenticalBranch
In: lib/nitpick/warnings/identical_branch.rb
Parent: SimpleWarning

Methods

matches?   message   new  

Attributes

no_branch  [R] 
yes_branch  [R] 

Public Class methods

[Source]

# File lib/nitpick/warnings/identical_branch.rb, line 5
      def initialize(*args)
        @cond, @yes_branch, @no_branch = args
      end

Public Instance methods

[Source]

# File lib/nitpick/warnings/identical_branch.rb, line 9
      def matches?
        yes_branch == no_branch
      end

[Source]

# File lib/nitpick/warnings/identical_branch.rb, line 13
      def message
        "The branches of 'if (#{sexp_to_ruby(@cond)})' are identical."
      end

[Validate]