Class: PaymobRuby::ApplicationService
- Inherits:
-
Object
- Object
- PaymobRuby::ApplicationService
show all
- Defined in:
- lib/paymob_ruby/api/application_service.rb
Defined Under Namespace
Classes: Response
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.call ⇒ Object
9
10
11
12
13
14
|
# File 'lib/paymob_ruby/api/application_service.rb', line 9
def self.call(...)
service = new
service.call(...)
rescue StandardError => e
service.failure(e)
end
|
Instance Method Details
#failure(exception) ⇒ Object
20
21
22
|
# File 'lib/paymob_ruby/api/application_service.rb', line 20
def failure(exception)
Response.new(false, nil, exception)
end
|
#success(payload = nil) ⇒ Object
16
17
18
|
# File 'lib/paymob_ruby/api/application_service.rb', line 16
def success(payload = nil)
Response.new(true, payload)
end
|