Class: PayjpMock::Response::Error::Base

Inherits:
Base
  • Object
show all
Defined in:
lib/payjp_mock/response/error/base.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods inherited from Base

#exception, #status, #to_h

Constructor Details

#initialize(code: nil, message: nil, param: nil) ⇒ Base

Returns a new instance of Base.



5
6
7
8
9
# File 'lib/payjp_mock/response/error/base.rb', line 5

def initialize(code: nil, message: nil, param: nil)
  @attributes = default_attributes.merge(
    { code: code, message: message, param: param }.compact
  )
end

Instance Method Details

#bodyObject



11
12
13
# File 'lib/payjp_mock/response/error/base.rb', line 11

def body
  { error: @attributes }.to_json
end