Class: CreditCardInfo::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/credit_card_info/response.rb,
lib/credit_card_info/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



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

def data
  @data
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



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

def error
  @error
end

Instance Method Details

#log_errorObject



24
25
26
27
28
# File 'lib/credit_card_info/response.rb', line 24

def log_error
  return unless CreditCardInfo.logger

  CreditCardInfo.logger.warn "Wrong response: error_code=#{error[:code]} error_message=#{error[:message]}"
end

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/credit_card_info/response.rb', line 20

def valid?
  error.nil?
end