Class: BSV::Auth::AuthResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/bsv/auth/auth_fetch.rb

Overview

Immutable value object representing an authenticated HTTP response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, headers:, body:, identity_key:) ⇒ AuthResponse

Returns a new instance of AuthResponse.

Parameters:

  • status (Integer)

    HTTP status code

  • headers (Hash)

    response headers

  • body (String)

    response body

  • identity_key (String)

    server’s compressed public key hex



379
380
381
382
383
384
# File 'lib/bsv/auth/auth_fetch.rb', line 379

def initialize(status:, headers:, body:, identity_key:)
  @status       = status
  @headers      = headers
  @body         = body
  @identity_key = identity_key
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



373
374
375
# File 'lib/bsv/auth/auth_fetch.rb', line 373

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



373
374
375
# File 'lib/bsv/auth/auth_fetch.rb', line 373

def headers
  @headers
end

#identity_keyObject (readonly)

Returns the value of attribute identity_key.



373
374
375
# File 'lib/bsv/auth/auth_fetch.rb', line 373

def identity_key
  @identity_key
end

#statusObject (readonly)

Returns the value of attribute status.



373
374
375
# File 'lib/bsv/auth/auth_fetch.rb', line 373

def status
  @status
end