Class: Sellsy::Attachment
- Inherits:
-
Object
- Object
- Sellsy::Attachment
- Defined in:
- lib/sellsy/attachment.rb
Instance Attribute Summary collapse
-
#entity_id ⇒ Object
Returns the value of attribute entity_id.
-
#entity_type ⇒ Object
Returns the value of attribute entity_type.
-
#file ⇒ Object
Returns the value of attribute file.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
Instance Attribute Details
#entity_id ⇒ Object
Returns the value of attribute entity_id.
3 4 5 |
# File 'lib/sellsy/attachment.rb', line 3 def entity_id @entity_id end |
#entity_type ⇒ Object
Returns the value of attribute entity_type.
3 4 5 |
# File 'lib/sellsy/attachment.rb', line 3 def entity_type @entity_type end |
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/sellsy/attachment.rb', line 3 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/sellsy/attachment.rb', line 3 def id @id end |
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# 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 |