Sha256: 6bc0c70e495012c05f24d0d7cccdaab8a2ed3a2218331830c41e005d5d164d04

Contents?: true

Size: 322 Bytes

Versions: 13

Compression:

Stored size: 322 Bytes

Contents

module Onfido
  class Document < Resource
    # with open-uri the file can be a link or an actual file

    def create(applicant_id, payload)
      payload[:file] = open(payload.fetch(:file), 'r')
      post(
        url: url_for("applicants/#{applicant_id}/documents"),
        payload: payload
      )
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
onfido-0.7.1 lib/onfido/resources/document.rb
onfido-0.7.0 lib/onfido/resources/document.rb
onfido-0.6.1 lib/onfido/resources/document.rb
onfido-0.6.0 lib/onfido/resources/document.rb
onfido-0.5.0 lib/onfido/resources/document.rb
onfido-0.4.0 lib/onfido/resources/document.rb
onfido-0.3.0 lib/onfido/document.rb
onfido-0.2.0 lib/onfido/document.rb
onfido-0.1.0 lib/onfido/document.rb
onfido-0.0.4 lib/onfido/document.rb
onfido-0.0.3 lib/onfido/document.rb
onfido-0.0.2 lib/onfido/document.rb
onfido-0.0.1 lib/onfido/document.rb