Class: ClassMetrix::Extractors::Services::Collection::MethodCollectionService

Inherits:
Object
  • Object
show all
Defined in:
lib/class_metrix/extractors/services/collection/method_collection_service.rb

Overview

Service responsible for collecting method names from classes

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ MethodCollectionService

Returns a new instance of MethodCollectionService.



12
13
14
# File 'lib/class_metrix/extractors/services/collection/method_collection_service.rb', line 12

def initialize(options = {})
  @options = options
end

Instance Method Details

#collect_from_classes(classes) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/class_metrix/extractors/services/collection/method_collection_service.rb', line 16

def collect_from_classes(classes)
  all_methods = Set.new

  classes.each do |klass|
    methods = collect_from_single_class(klass)
    all_methods.merge(methods.map(&:to_s))
  end

  all_methods.to_a.sort
end