Sha256: a1c25c36daa1245417ad8dca3a9829f7dd619cfbe62d578df9939d7ad7297b48

Contents?: true

Size: 485 Bytes

Versions: 39

Compression:

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

39 entries across 37 versions & 2 rubygems

Version Path
reek-6.4.0 lib/reek/context/statement_counter.rb
reek-6.3.0 lib/reek/context/statement_counter.rb
reek-6.2.0 lib/reek/context/statement_counter.rb
reek-6.1.4 lib/reek/context/statement_counter.rb
reek-6.1.3 lib/reek/context/statement_counter.rb
reek-6.1.2 lib/reek/context/statement_counter.rb
reek-6.1.1 lib/reek/context/statement_counter.rb
reek-6.1.0 lib/reek/context/statement_counter.rb
reek-6.0.6 lib/reek/context/statement_counter.rb
reek-6.0.5 lib/reek/context/statement_counter.rb
reek-6.0.4 lib/reek/context/statement_counter.rb
reek-6.0.3 lib/reek/context/statement_counter.rb
reek-6.0.2 lib/reek/context/statement_counter.rb
reek-6.0.1 lib/reek/context/statement_counter.rb
reek-6.0.0 lib/reek/context/statement_counter.rb
reek-5.6.0 lib/reek/context/statement_counter.rb
reek-5.5.0 lib/reek/context/statement_counter.rb
reek-5.4.1 lib/reek/context/statement_counter.rb
reek-5.4.0 lib/reek/context/statement_counter.rb
reek-5.3.2 lib/reek/context/statement_counter.rb