Class: Ribose::CLI::Commands::File
- Defined in:
- lib/ribose/cli/commands/file.rb
Instance Method Summary collapse
Instance Method Details
#add(file) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/ribose/cli/commands/file.rb', line 28 def add(file) file_upload = create_upload(file, ) if file_upload.id say("#{file_upload.name} added to your space!") end end |
#list ⇒ Object
9 10 11 |
# File 'lib/ribose/cli/commands/file.rb', line 9 def list say(build_output(list_files(), )) end |
#remove ⇒ Object
54 55 56 57 |
# File 'lib/ribose/cli/commands/file.rb', line 54 def remove Ribose::SpaceFile.delete([:space_id], [:file_id]) say("The file has been removed from your space!") end |
#show ⇒ Object
18 19 20 21 |
# File 'lib/ribose/cli/commands/file.rb', line 18 def show file = Ribose::SpaceFile.fetch([:space_id], [:file_id]) say(build_resource_output(file, )) end |
#update ⇒ Object
43 44 45 46 47 48 |
# File 'lib/ribose/cli/commands/file.rb', line 43 def update update_file(symbolize_keys()) say("The file has been updated with new attributes") rescue Ribose::UnprocessableEntity say("Something went wrong! Please check required attributes") end |