Class: Fog::Storage::Artifactory::File
- Inherits:
-
Model
- Object
- Model
- Fog::Storage::Artifactory::File
- Defined in:
- lib/fog/artifactory/models/storage/file.rb
Instance Method Summary collapse
- #body ⇒ Object
- #body=(new_body) ⇒ Object
- #destroy ⇒ Object
- #directory ⇒ Object
- #public_url ⇒ Object (also: #url)
- #save(_options = {}) ⇒ Object
Instance Method Details
#body ⇒ Object
22 23 24 25 26 |
# File 'lib/fog/artifactory/models/storage/file.rb', line 22 def body return attributes[:body] if attributes[:body] return '' unless last_modified attributes[:body] = service.client.get(download_uri) end |
#body=(new_body) ⇒ Object
28 29 30 |
# File 'lib/fog/artifactory/models/storage/file.rb', line 28 def body=(new_body) attributes[:body] = new_body end |
#destroy ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/fog/artifactory/models/storage/file.rb', line 36 def destroy requires :directory, :key service.client.delete(attributes[:download_uri]) true rescue Error::HTTPError false end |
#directory ⇒ Object
32 33 34 |
# File 'lib/fog/artifactory/models/storage/file.rb', line 32 def directory @directory end |
#public_url ⇒ Object Also known as: url
52 53 54 55 |
# File 'lib/fog/artifactory/models/storage/file.rb', line 52 def public_url requires :directory, :key self.download_uri end |
#save(_options = {}) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/fog/artifactory/models/storage/file.rb', line 44 def save( = {}) requires :body, :directory, :key endpoint = ::File.join(attributes[:repo], attributes[:key]) service.client.put(endpoint, attributes[:body]) true end |