module HttpEventLogger module Event class Request attr_reader :method, :uri, :headers, :body def initialize(args) @method = args[:method].to_s.upcase @uri = args[:uri].to_s @headers = HttpEventLogger::Event::Headers.new(args[:headers]) @body = args[:body] HttpEventLogger::Event::Observer.observe(:sent, self) end def base_uri matcher = @uri.match(/\/\/([^\/\?]*)/) matcher ? matcher[1] : "" end end end end