Sha256: 1ceda8f4ab74721d9e923cfcb15656205b0275b79aa176a4bf64d24c9ac34aeb

Contents?: true

Size: 586 Bytes

Versions: 28

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

module FinApps
  module REST
    class OrderReports < FinAppsCore::REST::Resources # :nodoc:
      def show(id, format)
        not_blank(id, :id)
        not_blank(format, :format)
        raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: format' unless accepted_format?(format)

        path =
          "orders/#{ERB::Util.url_encode(id)}/report.#{ERB::Util.url_encode(format)}"
        super nil, path
      end

      private

      def accepted_format?(format)
        %i[json html pdf].include? format.to_sym
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
finapps-5.0.32 lib/finapps/rest/order_reports.rb
finapps-5.0.31 lib/finapps/rest/order_reports.rb
finapps-5.0.30 lib/finapps/rest/order_reports.rb
finapps-5.0.29 lib/finapps/rest/order_reports.rb
finapps-5.0.28 lib/finapps/rest/order_reports.rb
finapps-5.0.27 lib/finapps/rest/order_reports.rb
finapps-5.0.26 lib/finapps/rest/order_reports.rb
finapps-5.0.25 lib/finapps/rest/order_reports.rb
finapps-5.0.24 lib/finapps/rest/order_reports.rb
finapps-5.0.23 lib/finapps/rest/order_reports.rb
finapps-5.0.22 lib/finapps/rest/order_reports.rb
finapps-5.0.21 lib/finapps/rest/order_reports.rb
finapps-5.0.20 lib/finapps/rest/order_reports.rb
finapps-5.0.19 lib/finapps/rest/order_reports.rb
finapps-5.0.17 lib/finapps/rest/order_reports.rb
finapps-5.0.16 lib/finapps/rest/order_reports.rb
finapps-5.0.15 lib/finapps/rest/order_reports.rb
finapps-5.0.14 lib/finapps/rest/order_reports.rb
finapps-5.0.13 lib/finapps/rest/order_reports.rb
finapps-5.0.12 lib/finapps/rest/order_reports.rb