Class: NodexPay::Transport::Response

Inherits:
Data
  • Object
show all
Defined in:
lib/nodex_pay/transport.rb,
sig/nodex_pay.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, headers:, body:) ⇒ Response

Returns a new instance of Response.



40
41
42
43
44
45
46
# File 'lib/nodex_pay/transport.rb', line 40

def initialize(status:, headers:, body:)
  immutable_headers = headers.to_h.each_with_object({}) do |(key, value), copy|
    copy[key.dup.freeze] = value.dup.freeze
  end.freeze

  super(status:, headers: immutable_headers, body: body.dup.freeze)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



39
40
41
# File 'lib/nodex_pay/transport.rb', line 39

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



39
40
41
# File 'lib/nodex_pay/transport.rb', line 39

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



39
40
41
# File 'lib/nodex_pay/transport.rb', line 39

def status
  @status
end