class RubyCritic::MethodsCounter

Public Class Methods

new(analysed_module) click to toggle source
# File lib/rubycritic/analysers/helpers/methods_counter.rb, line 7
def initialize(analysed_module)
  @analysed_module = analysed_module
end

Public Instance Methods

count() click to toggle source
# File lib/rubycritic/analysers/helpers/methods_counter.rb, line 11
def count
  node.count_nodes_of_type(:def, :defs)
end

Private Instance Methods

content() click to toggle source
# File lib/rubycritic/analysers/helpers/methods_counter.rb, line 21
def content
  File.read(@analysed_module.path)
end
node() click to toggle source
# File lib/rubycritic/analysers/helpers/methods_counter.rb, line 17
def node
  Parser.parse(content)
end