Sha256: 2175b80c5e6e7c44f62f7ab747cb3c6ef2705686863925f6131fa73bced46bd0

Contents?: true

Size: 868 Bytes

Versions: 3

Compression:

Stored size: 868 Bytes

Contents

require_relative '../uri_provider'

module MangoApi

  # Provides API method delegates concerning the +Repudiation+ entity
  module Repudiations
    class << self
      include UriProvider

      # Retrieves a repudiation entity.
      #
      # @param +id+ [String] ID of the repudiation to retrieve
      # @return [Repudiation] the requested Repudiation entity object
      def get(id)
        uri = provide_uri(:get_repudiation, id)
        response = HttpClient.get(uri)
        parse response
      end

      private

      # Parses a JSON-originating hash into the corresponding
      # Repudiation entity object.
      #
      # @param +response+ [Hash] JSON-originating data hash
      # @return [Repudiation] corresponding Repudiation entity object
      def parse(response)
        MangoModel::Repudiation.new.dejsonify response
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mangopay-v4-4.1.0 lib/mangopay/api/service/repudiations.rb
mangopay-v4-4.0.2 lib/mangopay/api/service/repudiations.rb
mangopay-v4-4.0.1 lib/mangopay/api/service/repudiations.rb