Sha256: f20c9c679a858bc1ffef9810107c807abb3c398ef6df4bcc0b745c4552a4ff81

Contents?: true

Size: 377 Bytes

Versions: 6

Compression:

Stored size: 377 Bytes

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
rubycritic-2.9.2 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-2.9.1 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-2.9.0 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-2.8.0 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-2.7.1 lib/rubycritic/analysers/helpers/methods_counter.rb
rubycritic-2.7.0 lib/rubycritic/analysers/helpers/methods_counter.rb