Class: Fondy::Response

Inherits:
BaseResponse show all
Defined in:
lib/fondy/response.rb

Instance Method Summary collapse

Methods inherited from BaseResponse

#error?, #initialize

Constructor Details

This class inherits a constructor from Fondy::BaseResponse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *_args) ⇒ Object



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

def method_missing(method, *_args)
  response[method] || super
end

Instance Method Details

#error_codeObject



12
13
14
# File 'lib/fondy/response.rb', line 12

def error_code
  response[:error_code]
end

#error_messageObject



16
17
18
# File 'lib/fondy/response.rb', line 16

def error_message
  response[:error_message]
end

#respond_to_missing?(method, *_args) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/fondy/response.rb', line 24

def respond_to_missing?(method, *_args)
  response.key?(method)
end

#success?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/fondy/response.rb', line 8

def success?
  response[:response_status] == 'success'
end

#to_hObject



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

def to_h
  response
end