Class Roodi::Checks::LineCountCheck
In: lib/roodi/checks/line_count_check.rb
Parent: Roodi::Checks::Check

Methods

Public Class methods

[Source]

# File lib/roodi/checks/line_count_check.rb, line 6
      def initialize(interesting_nodes, line_count, message_prefix)
        super()
        @interesting_nodes = interesting_nodes
        @line_count = line_count
        @message_prefix = message_prefix
      end

Public Instance methods

[Source]

# File lib/roodi/checks/line_count_check.rb, line 17
      def evaluate_start(node)
        line_count = count_lines(node)
        add_error "#{@message_prefix} \"#{node[1]}\" has #{line_count} lines.  It should have #{@line_count} or less." unless line_count <= @line_count
      end

[Source]

# File lib/roodi/checks/line_count_check.rb, line 13
      def interesting_nodes
        @interesting_nodes
      end

Protected Instance methods

[Source]

# File lib/roodi/checks/line_count_check.rb, line 24
      def count_lines(node)
        node.last.line - node.line - 1
      end

[Validate]