Class: PoliPage::ResponseEvent

Inherits:
Data
  • Object
show all
Defined in:
lib/poli_page/response_event.rb

Overview

Event payload for the ‘on_response` constructor hook. Fired immediately after a 2xx response is received from the transport (NOT fired on non-2xx — those go through `on_retry` / `on_error` instead). Parity with sdk-node `ResponseEvent` (src/types.ts:177-181).

  • ‘status` [Integer] HTTP status code (always 200-299).

  • ‘request_id` [String, nil] value of the `x-request-id` response

    header, or nil if the server didn't send one.
    
  • ‘duration_ms` [Integer] wall-clock duration of the HTTP attempt,

    measured around `@transport.execute`.
    

Instance Attribute Summary collapse

Instance Attribute Details

#duration_msObject (readonly)

Returns the value of attribute duration_ms

Returns:

  • (Object)

    the current value of duration_ms



14
15
16
# File 'lib/poli_page/response_event.rb', line 14

def duration_ms
  @duration_ms
end

#request_idObject (readonly)

Returns the value of attribute request_id

Returns:

  • (Object)

    the current value of request_id



14
15
16
# File 'lib/poli_page/response_event.rb', line 14

def request_id
  @request_id
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



14
15
16
# File 'lib/poli_page/response_event.rb', line 14

def status
  @status
end