Class: SecupayRuby::Requests::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/secupay_ruby/requests/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_status:, status:, data:, errors:) ⇒ Response

Returns a new instance of Response.



6
7
8
9
10
11
# File 'lib/secupay_ruby/requests/response.rb', line 6

def initialize(http_status:, status:, data:, errors:)
  self.http_status = http_status
  self.status = status
  self.data = data
  self.errors = errors
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



4
5
6
# File 'lib/secupay_ruby/requests/response.rb', line 4

def data
  @data
end

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/secupay_ruby/requests/response.rb', line 4

def errors
  @errors
end

#http_statusObject

Returns the value of attribute http_status.



4
5
6
# File 'lib/secupay_ruby/requests/response.rb', line 4

def http_status
  @http_status
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/secupay_ruby/requests/response.rb', line 4

def status
  @status
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/secupay_ruby/requests/response.rb', line 13

def failed?
  http_status != "200" || status != "ok"
end