Class Roodi::Checks::Check
In: lib/roodi/checks/check.rb
Parent: Object

Methods

Constants

NODE_TYPES = [:defn, :module, :resbody, :lvar, :cvar, :class, :if, :while, :until, :for, :rescue, :case, :when, :and, :or]

Public Class methods

[Source]

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

Public Instance methods

[Source]

# File lib/roodi/checks/check.rb, line 45
      def add_error(error)
        @errors << Roodi::Core::Error.new("#{@node.file}", "#{@node.line}", error)
      end

[Source]

# File lib/roodi/checks/check.rb, line 49
      def errors
        @errors
      end

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Validate]