Class: PoliPage::RequestEvent

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

Overview

Event payload for the ‘on_request` constructor hook. Fired immediately before each HTTP attempt — including the first one and every retry. Parity with sdk-node `RequestEvent` (src/types.ts:171-175).

  • ‘method` [String] uppercase HTTP verb (“GET” / “POST” / “DELETE”).

  • ‘url` [String] fully-resolved request URL (base_url + path).

  • ‘attempt` [Integer] 1-based attempt counter — first send is `1`, the

    first retry is `2`, etc.
    

Naming ‘:method` shadows `Object#method`, but the field name is fixed by Node-SDK parity (`RequestEvent.method` is the public payload shape). Callers won’t reach for ‘event.method(:foo)` on a value-typed event.

Instance Attribute Summary collapse

Instance Attribute Details

#attemptObject (readonly)

Returns the value of attribute attempt

Returns:

  • (Object)

    the current value of attempt



16
17
18
# File 'lib/poli_page/request_event.rb', line 16

def attempt
  @attempt
end

#methodObject (readonly)

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



16
17
18
# File 'lib/poli_page/request_event.rb', line 16

def method
  @method
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



16
17
18
# File 'lib/poli_page/request_event.rb', line 16

def url
  @url
end