Class: RailsBestPractices::Checks::Check

### Home Classes Methods

### In Files

- lib/rails_best_practices/checks/check.rb

### Parent

Object

### Methods

- ::new
- #add_error
- #evaluate_end
- #evaluate_node
- #evaluate_node_end
- #evaluate_node_start
- #evaluate_start
- #interesting_files
- #position

### Files

- LICENSE

### Class/Module Index

Quicksearch

- RailsBestPractices
- RailsBestPractices::Checks
- RailsBestPractices::Checks::AddModelVirtualAttributeCheck
- RailsBestPractices::Checks::AlwaysAddDbIndexCheck
- RailsBestPractices::Checks::Check
- RailsBestPractices::Checks::IsolateSeedDataCheck
- RailsBestPractices::Checks::KeepFindersOnTheirOwnModelCheck
- RailsBestPractices::Checks::LawOfDemeterCheck
- RailsBestPractices::Checks::ManyToManyCollectionCheck
- RailsBestPractices::Checks::MoveCodeIntoControllerCheck
- RailsBestPractices::Checks::MoveCodeIntoHelperCheck
- RailsBestPractices::Checks::MoveCodeIntoModelCheck
- RailsBestPractices::Checks::MoveFinderToNamedScopeCheck
- RailsBestPractices::Checks::MoveModelLogicIntoModelCheck
- RailsBestPractices::Checks::NeedlessDeepNestingCheck
- RailsBestPractices::Checks::NestedModelFormsCheck
- RailsBestPractices::Checks::NotUseDefaultRouteCheck
- RailsBestPractices::Checks::OveruseRouteCustomizationsCheck
- RailsBestPractices::Checks::ReplaceComplexCreationWithFactoryMethodCheck
- RailsBestPractices::Checks::ReplaceInstanceVariableWithLocalVariableCheck
- RailsBestPractices::Checks::UseBeforeFilterCheck
- RailsBestPractices::Checks::UseModelAssociationCheck
- RailsBestPractices::Checks::UseModelCallbackCheck
- RailsBestPractices::Checks::UseObserverCheck
- RailsBestPractices::Checks::UseScopeAccessCheck
- RailsBestPractices::Core
- RailsBestPractices::Core::CheckingVisitor
- RailsBestPractices::Core::Error
- RailsBestPractices::Core::Runner
- Enumerable
- NilClass
- Sexp
- String

No matching classes.

# RailsBestPractices::Checks::Check

### Constants

CONTROLLER_FILES
MIGRATION_FILES
MODLE_FILES
NODE_TYPES
PARTIAL_VIEW_FILES
VIEW_FILES

### Attributes

errors[R]

### Public Class Methods

new() click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 16
    def initialize
      @errors = []
    end

### Public Instance Methods

add_error(error, file = nil, line = nil) click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 57
    def add_error(error, file = nil, line = nil)
      file ||= @node.file
      line ||= @node.line
      @errors << RailsBestPractices::Core::Error.new("#{file}", "#{line}", error)
    end

evaluate_end(node) click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 38
    def evaluate_end(node)
    end

evaluate_node(position, node) click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 41
    def evaluate_node(position, node)
      @node = node
      eval_method = "evaluate_#{position}_#{node.node_type}"
      self.send(eval_method, node)
    end

evaluate_node_end(node) click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 52
    def evaluate_node_end(node)
      evaluate_node(:end, node)
      evaluate_end(node)
    end

evaluate_node_start(node) click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 47
    def evaluate_node_start(node)
      evaluate_node(:start, node)
      evaluate_start(node)
    end

evaluate_start(node) click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 35
    def evaluate_start(node)
    end

interesting_files() click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 20
    def interesting_files
      /.*/
    end

position(offset = 0) click to toggle source

    # File lib/rails_best_practices/checks/check.rb, line 31
    def position(offset = 0)
      "#{@line[2]}:#{@line[1] + offset}"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.