Class: SeeingIsBelieving::EventStream::Handlers::RecordExitEvents

Inherits:
Object
  • Object
show all
Defined in:
lib/seeing_is_believing/event_stream/handlers/record_exit_events.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(next_observer) ⇒ RecordExitEvents

Returns a new instance of RecordExitEvents.



10
11
12
# File 'lib/seeing_is_believing/event_stream/handlers/record_exit_events.rb', line 10

def initialize(next_observer)
  @next_observer = next_observer
end

Instance Attribute Details

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



7
8
9
# File 'lib/seeing_is_believing/event_stream/handlers/record_exit_events.rb', line 7

def exitstatus
  @exitstatus
end

#timeout_secondsObject (readonly)

Returns the value of attribute timeout_seconds.



8
9
10
# File 'lib/seeing_is_believing/event_stream/handlers/record_exit_events.rb', line 8

def timeout_seconds
  @timeout_seconds
end

Instance Method Details

#call(event) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/seeing_is_believing/event_stream/handlers/record_exit_events.rb', line 14

def call(event)
  case event
  when Events::Exitstatus
    @exitstatus = event.value
  when Events::Timeout
    @timeout_seconds = event.seconds
  end
  @next_observer.call(event)
end