Module: Conjur::Exists
- Included in:
- ActsAsAsset, Deputy, Resource, Role
- Defined in:
- lib/conjur/exists.rb
Overview
Instance Method Summary collapse
-
#exists?(options = {}) ⇒ Boolean
Check whether this asset exists by performing a HEAD request to its URL.
Instance Method Details
#exists?(options = {}) ⇒ Boolean
Check whether this asset exists by performing a HEAD request to its URL.
This method will return false if the asset doesn't exist.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/conjur/exists.rb', line 49 def exists?( = {}) begin self.head() true rescue RestClient::Forbidden true rescue RestClient::ResourceNotFound false end end |