Class: Rack::TrafficLogger::StreamSimulator
- Inherits:
-
Object
- Object
- Rack::TrafficLogger::StreamSimulator
- Defined in:
- lib/rack/traffic_logger/stream_simulator.rb
Instance Method Summary collapse
- #format(input) ⇒ Object
-
#initialize(color: false, pretty_print: false) ⇒ StreamSimulator
constructor
A new instance of StreamSimulator.
Constructor Details
#initialize(color: false, pretty_print: false) ⇒ StreamSimulator
Returns a new instance of StreamSimulator.
5 6 7 8 |
# File 'lib/rack/traffic_logger/stream_simulator.rb', line 5 def initialize(color: false, pretty_print: false) @color = color @pretty_print = pretty_print end |
Instance Method Details
#format(input) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rack/traffic_logger/stream_simulator.rb', line 10 def format(input) case input['event'] when 'request' then format_request input when 'response' then format_response input else nil end end |