Sha256: 6b83666748da11af0e62e1d4cb2812d003461e0a6894b0617f5b00630fd13cd6

Contents?: true

Size: 606 Bytes

Versions: 2

Compression:

Stored size: 606 Bytes

Contents

require 'rails_best_practices/checks/check'

module RailsBestPractices
  module Checks
    # Check a partail view file to make sure there is no instance variable.
    #
    # Implementation: Check all instance variable, if exists, then it should be replaced with local variable
    class ReplaceInstanceVariableWithLocalVariableCheck < Check
      
      def interesting_nodes
        [:ivar]
      end
      
      def interesting_files
        PARTIAL_VIEW_FILES
      end
      
      def evaluate_start(node)
        add_error "replace instance variable with local variable"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_best_practices-0.3.0 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.2.16 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb