Class: FileAttachment
- Inherits:
-
Flareshow::Resource
- Object
- Flareshow::Resource
- FileAttachment
- Extended by:
- Flareshow::Searchable
- 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 included from Flareshow::Searchable
Methods inherited from Flareshow::Resource
#cache, cache_response, #changes, create, #destroy, #destroyed?, find, #get, get_from_cache, #id, #initialize, list_cache, #method_missing, #method_name, #refresh, #resource_key, #save, #set, store, #update
Constructor Details
This class inherits a constructor from Flareshow::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Flareshow::Resource
Class Method Details
.resource_key ⇒ Object
file attachments has a resource key of files for querying the server
11 12 13 |
# File 'lib/file_attachment.rb', line 11 def resource_key "files" end |
Instance Method Details
#download ⇒ Object
download the file contents
17 18 19 20 21 22 23 24 |
# File 'lib/file_attachment.rb', line 17 def download url = self.url unless url.match(/http/) url = "http://#{Flareshow::Base.server.host}/#{Flareshow::Base.server.domain}#{url}" end Flareshow::Util.log_info("getting #{url}") self.class.http_get(url) end |