class Sellsy::Attachment

Attributes

entity_id[RW]
entity_type[RW]
file[RW]
id[RW]

Public Instance Methods

create() click to toggle source
# File lib/sellsy/attachment.rb, line 5
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