Class: FileAttachment
- Inherits:
-
Flareshow::Base
- Object
- Flareshow::Base
- FileAttachment
- Defined in:
- lib/file_attachment.rb
Class Method Summary collapse
-
.resource_key ⇒ Object
file attachments has a resource key of files for querying the server.
Instance Method Summary collapse
-
#download ⇒ Object
download the file contents.
Methods inherited from Flareshow::Base
all, api_endpoint, assimilate_resources, auth_endpoint, authenticate, #changes, commit, create, #destroy, #destroyed?, dispatch, find, first, get, #get, handle_response, http_get, #id, #initialize, list, #method_missing, #method_name, post, process_response, query, #refresh, #save, server_defined?, #set, store, #update
Constructor Details
This class inherits a constructor from Flareshow::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Flareshow::Base
Class Method Details
.resource_key ⇒ Object
file attachments has a resource key of files for querying the server
9 10 11 |
# File 'lib/file_attachment.rb', line 9 def resource_key "files" end |
Instance Method Details
#download ⇒ Object
download the file contents
15 16 17 18 19 20 21 22 |
# File 'lib/file_attachment.rb', line 15 def download url = self.url unless url.match(/http/) url = "http://#{Flareshow::Base.server.host}/#{Flareshow::Base.server.domain}#{url}" end Util.log_info("getting #{url}") self.class.http_get(url) end |