Class: Racli::Handlers::DefaultHandler

Inherits:
Base
  • Object
show all
Defined in:
lib/racli/handlers/default_handler.rb

Instance Attribute Summary

Attributes inherited from Base

#cli

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Racli::Handlers::Base

Instance Method Details

#call(status, headers, body, _original_args) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/racli/handlers/default_handler.rb', line 8

def call(status, headers, body, _original_args)
  case status.to_i
  when 200...300
    puts body[0]
  when 400...600
    STDERR.puts body[0]
  end
  [status, headers, body]
end