Class: Samuel::LogEntries::HttpClient

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/samuel/log_entries/http_client.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #log!

Constructor Details

This class inherits a constructor from Samuel::LogEntries::Base

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/samuel/log_entries/http_client.rb', line 21

def error?
  @response.is_a?(Exception) || @response.status.to_s =~ /^(4|5)/
end

#methodObject



9
10
11
# File 'lib/samuel/log_entries/http_client.rb', line 9

def method
  @request.header.request_method
end

#status_codeObject



13
14
15
# File 'lib/samuel/log_entries/http_client.rb', line 13

def status_code
  @response.status
end

#status_messageObject



17
18
19
# File 'lib/samuel/log_entries/http_client.rb', line 17

def status_message
  @response.header.reason_phrase.strip
end