Class: Risenexa::Tracking::Result
- Inherits:
-
Object
- Object
- Risenexa::Tracking::Result
- Defined in:
- lib/risenexa/tracking/result.rb
Overview
Value object returned on successful event tracking (HTTP 202).
Instance Attribute Summary collapse
-
#body ⇒ Hash
readonly
Parsed JSON response body.
-
#event_id ⇒ String
readonly
UUID v4 sent in the request (idempotency anchor).
-
#status_code ⇒ Integer
readonly
HTTP status code (202 on success).
Instance Method Summary collapse
-
#initialize(status_code:, event_id:, body:) ⇒ Result
constructor
A new instance of Result.
-
#success? ⇒ Boolean
True when status_code is 202.
Constructor Details
#initialize(status_code:, event_id:, body:) ⇒ Result
Returns a new instance of Result.
23 24 25 26 27 |
# File 'lib/risenexa/tracking/result.rb', line 23 def initialize(status_code:, event_id:, body:) @status_code = status_code @event_id = event_id @body = body end |
Instance Attribute Details
#body ⇒ Hash (readonly)
Returns Parsed JSON response body.
21 22 23 |
# File 'lib/risenexa/tracking/result.rb', line 21 def body @body end |
#event_id ⇒ String (readonly)
Returns UUID v4 sent in the request (idempotency anchor).
18 19 20 |
# File 'lib/risenexa/tracking/result.rb', line 18 def event_id @event_id end |
#status_code ⇒ Integer (readonly)
Returns HTTP status code (202 on success).
15 16 17 |
# File 'lib/risenexa/tracking/result.rb', line 15 def status_code @status_code end |
Instance Method Details
#success? ⇒ Boolean
Returns true when status_code is 202.
30 31 32 |
# File 'lib/risenexa/tracking/result.rb', line 30 def success? @status_code == 202 end |