Sha256: 03f563fd80afac2bad26f73d4902df6ab114b6dbc6915da1b3261cbcf76cd32e

Contents?: true

Size: 607 Bytes

Versions: 30

Compression:

Stored size: 607 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

30 entries across 30 versions & 1 rubygems

Version Path
rails_best_practices-0.4.2 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.4.1 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.4.0 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.27 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.26 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.25 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.24 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.23 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.22 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.21 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.20 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.19 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.18 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.17 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.16 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.15 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.14 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.13 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.12 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb
rails_best_practices-0.3.11 lib/rails_best_practices/checks/replace_instance_variable_with_local_variable_check.rb