Sha256: d009361bdbf63eb200d561a630f444af2d5fd59b50b778e249e999cc2df45d45

Contents?: true

Size: 453 Bytes

Versions: 10

Compression:

Stored size: 453 Bytes

Contents

module Sellsy
  class Attachment
    attr_accessor :id, :entity_id, :entity_type, :file

    def create
      command = {
          'method' => 'Briefcases.uploadFile',
          'params' => {
              'linkedtype' => @entity_type,
              'linkedid' => @entity_id
          }
      }

      response = MultiJson.load(Sellsy::Api.request(command, file))
      @id = response['response']
      response['status'] == 'success'
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sellsy-client-0.10.0 lib/sellsy/attachment.rb
sellsy-client-0.9.0 lib/sellsy/attachment.rb
sellsy-client-0.8.0 lib/sellsy/attachment.rb
sellsy-client-0.7.0 lib/sellsy/attachment.rb
sellsy-client-0.6.0 lib/sellsy/attachment.rb
sellsy-client-0.5.0 lib/sellsy/attachment.rb
sellsy-client-0.4.0 lib/sellsy/attachment.rb
sellsy-client-0.3.0 lib/sellsy/attachment.rb
sellsy-client-0.2.0 lib/sellsy/attachment.rb
sellsy-client-0.1.0 lib/sellsy/attachment.rb