Sha256: b74c8a9cbbec78890d14370bee56df909e6f8886cc425901d40f90b26da9a331

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

module Fizzy
  module Api
    class RenderOverview < ActiveInteraction::Base
      string :dossier_id
      string :protocol_subscription_id

      def execute
        response = Api.basic_auth_session.get("/dossier/#{dossier_id}"\
                                   "/protocol_subscriptions/#{protocol_subscription_id}" \
                                   '/render.json')
        process_response(response)
      end

      private

      def process_response(response)
        case response.code
        when 200
          response
        else
          raise Errors::UnexpectedStatusError, "Status code #{response.code} not expected."
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fizzy-api-0.0.6 lib/fizzy/api/render_overview.rb
fizzy-api-0.0.5 lib/fizzy/api/render_overview.rb