# frozen_string_literal: true require 'forwardable' module Iwoca class Response extend Forwardable def_delegators :@http_response, :body, :status, :success? def initialize(http_response) @http_response = http_response end def errors @http_response.body&.dig(:errors) || [] end def data @http_response.body&.dig(:data) || {} end end end