Sha256: ce808af268104859cf1c2e415a981e483282a427a3da3fcd030e4dcc6ef81e3d

Contents?: true

Size: 948 Bytes

Versions: 3

Compression:

Stored size: 948 Bytes

Contents

module Roqua
  module CoreApi
    module Sessions
      class DossierGroupSession < OrganizationSession
        attr_reader :dossier_group_id

        def initialize(dossier_group_id, organization_id, server_url = ENV["CORE_URL"], auth: nil)
          @dossier_group_id = dossier_group_id
          super(organization_id, server_url, auth: auth)
        end

        # create_dossier(.. , person: { email: 'user@domain.com' })
        def create_dossier(attributes)
          response = post "/dossiers", person: attributes.delete(:person), dossier: attributes
          fail response.inspect unless response.code == 201
          Models::Dossier.new(response)
        end

        def dossier_session(dossier_id)
          DossierSession.new dossier_id, dossier_group_id, organization_id, server_url
        end

        private

        def base_url
          super + "/dossier_groups/#{dossier_group_id}"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roqua-core-api-0.0.9 lib/roqua/core_api/sessions/dossier_group_session.rb
roqua-core-api-0.0.8 lib/roqua/core_api/sessions/dossier_group_session.rb
roqua-core-api-0.0.7 lib/roqua/core_api/sessions/dossier_group_session.rb