Sha256: a301a829c4b4d6a98d426d12f46761c2061a99e255c3d07b17e4d30ab1b9c73d

Contents?: true

Size: 625 Bytes

Versions: 10

Compression:

Stored size: 625 Bytes

Contents

# encoding: utf-8
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

10 entries across 10 versions & 1 rubygems

Version Path
rails_best_practices-0.5.6 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.5.5 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.5.3 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.5.2 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.5.1 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.5.0 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.4.6 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.4.5 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.4.4 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.4.3 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb