Sha256: 53c35c5044996810c12ab3cb06551e15a3ca369ccd244b8443c5c79922ead939

Contents?: true

Size: 395 Bytes

Versions: 5

Compression:

Stored size: 395 Bytes

Contents

module Nitpick
  module Warnings
    class IdenticalBranch < SimpleWarning
      attr_reader :yes_branch, :no_branch
      def initialize(*args)
        @cond, @yes_branch, @no_branch = args
      end
        
      def matches?
        yes_branch == no_branch
      end
      
      def message
        "The branches of 'if (#{sexp_to_ruby(@cond)})' are identical."
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
kevinclark-nitpick-1.0.0 lib/nitpick/warnings/identical_branch.rb
kevinclark-nitpick-1.0.1 lib/nitpick/warnings/identical_branch.rb
nitpick-1.0.1 lib/nitpick/warnings/identical_branch.rb
nitpick-1.0.2 lib/nitpick/warnings/identical_branch.rb
nitpick-1.0.0 lib/nitpick/warnings/identical_branch.rb