Class: Brute::Events::TerminalOutput

Inherits:
Handler
  • Object
show all
Defined in:
lib/brute/events/terminal_output_handler.rb

Instance Method Summary collapse

Methods inherited from Handler

#initialize

Constructor Details

This class inherits a constructor from Brute::Events::Handler

Instance Method Details

#<<(event) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/brute/events/terminal_output_handler.rb', line 9

def <<(event)
  $stdout.sync = true

  type = event.to_h[:type]
  data = event.to_h[:data]

  method = "on_#{type}"

  if respond_to?(method, true)
    send(method, data) 
  end

  super
end