Class: DevinApi::Resources::Attachment
- Defined in:
- lib/devin_api/resources/attachment.rb
Overview
Attachment resource for the Devin API
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #path ⇒ Object
-
#upload_file(file) ⇒ String
Upload a file for Devin to work with during sessions.
Methods inherited from Base
#[], #[]=, create, #id, #initialize, #method_missing, pagination_supported?, resource_name, resource_path, #respond_to_missing?, #to_hash
Constructor Details
This class inherits a constructor from DevinApi::Resources::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class DevinApi::Resources::Base
Instance Method Details
#path ⇒ Object
9 10 11 |
# File 'lib/devin_api/resources/attachment.rb', line 9 def path '/v1/attachments' end |
#upload_file(file) ⇒ String
Upload a file for Devin to work with during sessions
18 19 20 21 22 |
# File 'lib/devin_api/resources/attachment.rb', line 18 def upload_file(file) payload = { file: Faraday::UploadIO.new(file.path, 'application/octet-stream', File.basename(file.path)) } client.connection.post(path, payload).body end |