Class: Bcash::Api::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/bcash/api/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



5
6
7
8
9
# File 'lib/bcash/api/response.rb', line 5

def initialize(response)
  self.success = false
  @http_code = response.code
  parse_body(response)
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/bcash/api/response.rb', line 3

def body
  @body
end

#codeObject

Returns the value of attribute code.



3
4
5
# File 'lib/bcash/api/response.rb', line 3

def code
  @code
end

#http_codeObject

Returns the value of attribute http_code.



3
4
5
# File 'lib/bcash/api/response.rb', line 3

def http_code
  @http_code
end

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/bcash/api/response.rb', line 3

def message
  @message
end

#successObject

Returns the value of attribute success.



3
4
5
# File 'lib/bcash/api/response.rb', line 3

def success
  @success
end

Instance Method Details

#errorsObject



19
20
21
# File 'lib/bcash/api/response.rb', line 19

def errors
  body['list']
end

#messagesObject



27
28
29
# File 'lib/bcash/api/response.rb', line 27

def messages
  message
end

#success?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/bcash/api/response.rb', line 23

def success?
  success
end