Sha256: 2a7f0c46169a3b1395404b5ab8e36949bb0d36c30c0f98c5c835776c30b0a7ee

Contents?: true

Size: 484 Bytes

Versions: 19

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true
require_relative '../ast/node'

module Reek
  module Context
    # Responsible for counting the statements in a `CodeContext`.
    class StatementCounter
      attr_reader :value

      def initialize
        @value = 0
      end

      def increase_by(sexp)
        self.value = value + sexp.length if sexp
      end

      def decrease_by(number)
        self.value = value - number
      end

      private

      attr_writer :value
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
reek-4.6.1 lib/reek/context/statement_counter.rb
reek-4.6.0 lib/reek/context/statement_counter.rb
reek-4.5.6 lib/reek/context/statement_counter.rb
reek-4.5.5 lib/reek/context/statement_counter.rb
reek-4.5.4 lib/reek/context/statement_counter.rb
reek-4.5.3 lib/reek/context/statement_counter.rb
reek-4.5.2 lib/reek/context/statement_counter.rb
reek-4.5.1 lib/reek/context/statement_counter.rb
reek-4.5.0 lib/reek/context/statement_counter.rb
reek-4.4.2 lib/reek/context/statement_counter.rb
reek-4.4.1 lib/reek/context/statement_counter.rb
reek-4.4.0 lib/reek/context/statement_counter.rb
reek-4.3.0 lib/reek/context/statement_counter.rb
reek-4.2.5 lib/reek/context/statement_counter.rb
reek-4.2.4 lib/reek/context/statement_counter.rb
reek-4.2.3 lib/reek/context/statement_counter.rb
reek-4.2.2 lib/reek/context/statement_counter.rb
reek-4.2.1 lib/reek/context/statement_counter.rb
reek-4.2.0 lib/reek/context/statement_counter.rb