Class: Riiif::HTTPFileResolver::RemoteFile
- Inherits:
-
Object
- Object
- Riiif::HTTPFileResolver::RemoteFile
- Includes:
- ActiveSupport::Benchmarkable
- Defined in:
- lib/riiif/http_file_resolver.rb
Instance Attribute Summary collapse
-
#cache_path ⇒ Object
readonly
Returns the value of attribute cache_path.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #basic_auth_credentials ⇒ Object
- #fetch ⇒ Object
-
#initialize(url, options = {}) ⇒ RemoteFile
constructor
A new instance of RemoteFile.
Constructor Details
#initialize(url, options = {}) ⇒ RemoteFile
Returns a new instance of RemoteFile.
34 35 36 37 |
# File 'lib/riiif/http_file_resolver.rb', line 34 def initialize(url, = {}) @url = url @options = end |
Instance Attribute Details
#cache_path ⇒ Object (readonly)
Returns the value of attribute cache_path.
33 34 35 |
# File 'lib/riiif/http_file_resolver.rb', line 33 def cache_path @cache_path end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
33 34 35 |
# File 'lib/riiif/http_file_resolver.rb', line 33 def url @url end |
Instance Method Details
#basic_auth_credentials ⇒ Object
43 44 45 |
# File 'lib/riiif/http_file_resolver.rb', line 43 def basic_auth_credentials @options[:basic_auth_credentials] end |
#fetch ⇒ Object
47 48 49 50 |
# File 'lib/riiif/http_file_resolver.rb', line 47 def fetch download_file unless ::File.exist?(file_name) file_name end |