Sha256: d6cab91c7e8b697ebc911fe13121fa10c1fede362865aa3d602ca5c182492535

Contents?: true

Size: 407 Bytes

Versions: 7

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true
require 'rubycritic/analysers/helpers/parser'

module RubyCritic
  class MethodsCounter
    def initialize(analysed_module)
      @analysed_module = analysed_module
    end

    def count
      node.count_nodes_of_type(:def, :defs)
    end

    private

    def node
      Parser.parse(content)
    end

    def content
      File.read(@analysed_module.path)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubycritic-3.2.0 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-3.1.3 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-3.1.2 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-3.1.1 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-3.1.0 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-3.0.0 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-2.9.4 lib/rubycritic/analysers/helpers/methods_counter.rb