Class: AwsLogCleaner::LogGroupFilterer

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_log_cleaner/log_group_filterer.rb

Instance Method Summary collapse

Constructor Details

#initialize(cloud_watch_logs) ⇒ LogGroupFilterer

Returns a new instance of LogGroupFilterer.



3
4
5
# File 'lib/aws_log_cleaner/log_group_filterer.rb', line 3

def initialize(cloud_watch_logs)
  @cloud_watch_logs = cloud_watch_logs
end

Instance Method Details

#filter_by_name_includes(text) ⇒ Object



7
8
9
10
11
12
# File 'lib/aws_log_cleaner/log_group_filterer.rb', line 7

def filter_by_name_includes(text)
  log_groups = @cloud_watch_logs.list_all_log_groups
  log_groups.select do |item|
    item.log_group_name.to_s.downcase.include?(text)
  end
end