Sha256: e0c3ab78dc53da0c53f23d0e5d82d3855920135c8e4ac7b92596403646a0a486

Contents?: true

Size: 495 Bytes

Versions: 1

Compression:

Stored size: 495 Bytes

Contents

# frozen_string_literal: true

require_relative 'client'
require_relative 'error'

module WaCloudApi
  module Message
    class Service
      class << self
        def deliver(params:)
          response = Client.deliver(params: params)
          handle_failure(response) unless response.ok?
          response
        end

        private

        def handle_failure(response)
          WaCloudApi::Message::Error.new(response.data[:error]).handle_error
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wa_cloud_api-0.1.1 lib/wa_cloud_api/message/service.rb