Class: Ribose::SpaceFile
- Includes:
- Actions::All
- Defined in:
- lib/ribose/space_file.rb
Class Method Summary collapse
-
.all(space_id, options = {}) ⇒ Array<Sawyer::Resource>
List Files for Space.
-
.create(space_id, file:, **attributes) ⇒ Sawyer::Resource
Create a new file upload.
Methods included from Actions::All
Methods included from Actions::Base
Methods inherited from Base
Methods included from ResourceHelper
#resource_id, #resource_key, #resource_path, #resources
Constructor Details
This class inherits a constructor from Ribose::Base
Class Method Details
.all(space_id, options = {}) ⇒ Array<Sawyer::Resource>
List Files for Space
This interface retrieves the files for any specific space, and the usages is pretty simple all we need to do, provide the space id and it will return the files as ‘Sawyer::Resource`
17 18 19 |
# File 'lib/ribose/space_file.rb', line 17 def self.all(space_id, = {}) new(space_id: space_id, **).all end |
.create(space_id, file:, **attributes) ⇒ Sawyer::Resource
Create a new file upload
28 29 30 31 |
# File 'lib/ribose/space_file.rb', line 28 def self.create(space_id, file:, **attributes) upload = FileUploader.upload(space_id, attributes.merge(file: file)) upload[:attachment] end |