Class: StackMaster::StackEvents::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/stack_master/stack_events/fetcher.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stack_name, region, from: nil) ⇒ Fetcher

Returns a new instance of Fetcher.



8
9
10
11
12
# File 'lib/stack_master/stack_events/fetcher.rb', line 8

def initialize(stack_name, region, from: nil)
  @stack_name = stack_name
  @region = region
  @from = from
end

Class Method Details

.fetch(stack_name, region, **args) ⇒ Object



4
5
6
# File 'lib/stack_master/stack_events/fetcher.rb', line 4

def self.fetch(stack_name, region, **args)
  new(stack_name, region, **args).fetch
end

Instance Method Details

#fetchObject



14
15
16
17
18
19
20
21
# File 'lib/stack_master/stack_events/fetcher.rb', line 14

def fetch
  events = fetch_events
  if @from
    filter_old_events(events)
  else
    events
  end
end