Sha256: d7510be2ffc9ea1c04b002f59ad7517b0a0dd6daf6769f415e265e407c04c339

Contents?: true

Size: 593 Bytes

Versions: 4

Compression:

Stored size: 593 Bytes

Contents

module Roqua
  module CoreApi
    # @api private
    class UpdateDossier < Base
      model :session, class: Sessions::AuthSession
      model :dossier, class: Models::Dossier

      # Saves the dossier attributes to server.
      # Returns true on success, false on validation errors.
      # Raises on other errors.
      def execute
        response = session.patch "/dossiers/#{dossier.id}", dossier: dossier.serializable_hash
        if response.code == 422
          errors_to_object(response, dossier)
          false
        else
          true
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
roqua-core-api-0.1.1 lib/roqua/core_api/update_dossier.rb
roqua-core-api-0.1.0 lib/roqua/core_api/update_dossier.rb
roqua-core-api-0.0.39 lib/roqua/core_api/update_dossier.rb
roqua-core-api-0.0.38 lib/roqua/core_api/update_dossier.rb