Class: Payture::Cheques::Responses::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/payture/cheques/responses/base.rb

Direct Known Subclasses

Create, Status

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Base

Returns a new instance of Base.



8
9
10
# File 'lib/payture/cheques/responses/base.rb', line 8

def initialize(body)
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/payture/cheques/responses/base.rb', line 6

def body
  @body
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/payture/cheques/responses/base.rb', line 16

def error?
  !success?
end

#error_codeObject



20
21
22
# File 'lib/payture/cheques/responses/base.rb', line 20

def error_code
  body['ErrCode']
end

#error_messagesObject



24
25
26
# File 'lib/payture/cheques/responses/base.rb', line 24

def error_messages
  body['ErrMessages']
end

#success?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/payture/cheques/responses/base.rb', line 12

def success?
  body['Success'] == 'True'
end