Class: Stackup::Monitor

Inherits:
Object
  • Object
show all
Defined in:
lib/stackup/monitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stack) ⇒ Monitor

Returns a new instance of Monitor.



4
5
6
7
# File 'lib/stackup/monitor.rb', line 4

def initialize(stack)
  @stack = stack
  @events = Set.new
end

Instance Attribute Details

#eventsObject

Returns the value of attribute events.



3
4
5
# File 'lib/stackup/monitor.rb', line 3

def events
  @events
end

#stackObject

Returns the value of attribute stack.



3
4
5
# File 'lib/stackup/monitor.rb', line 3

def stack
  @stack
end

Instance Method Details

#new_eventsObject



9
10
11
12
13
14
15
# File 'lib/stackup/monitor.rb', line 9

def new_events
  stack.events.take_while do |event|
    !seen?(event)
  end.reverse
rescue ::Aws::CloudFormation::Errors::ValidationError => e
  []
end