Skip to content

Instantly share code, notes, and snippets.

View thiagodsalles's full-sized avatar

Thiago Guimarães de Salles thiagodsalles

View GitHub Profile
@thiagodsalles
thiagodsalles / .rb
Created June 25, 2023 03:18
api class with response object dealing with exceptions
module ApiService
class Client
class Response
def initialize(code: nil, body: nil)
@code = code
@body = body
end
def success?
return true if (200..299).include?(code)