Class: Cardflex::ErrorResponse

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/cardflex/error_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included, #method_missing

Methods included from BaseModule::ClassMethods

#create_helper_methods, #set_instance_variables_from_hash, #snakecase

Constructor Details

#initialize(gateway, hash = {}) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



7
8
9
10
11
12
# File 'lib/cardflex/error_response.rb', line 7

def initialize(gateway, hash={})
  @gateway = gateway
  @result = hash[:result].to_i
  @result_code = hash[:result_code]
  @result_text = hash[:result_text]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cardflex::BaseModule

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



5
6
7
# File 'lib/cardflex/error_response.rb', line 5

def result
  @result
end

#result_codeObject (readonly)

Returns the value of attribute result_code.



5
6
7
# File 'lib/cardflex/error_response.rb', line 5

def result_code
  @result_code
end

#result_textObject (readonly)

Returns the value of attribute result_text.



5
6
7
# File 'lib/cardflex/error_response.rb', line 5

def result_text
  @result_text
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/cardflex/error_response.rb', line 14

def success?
  false
end