Class: Riiif::HttpFileResolver::RemoteFile
- Inherits:
-
Object
- Object
- Riiif::HttpFileResolver::RemoteFile
- Includes:
- ActiveSupport::Benchmarkable
- Defined in:
- app/resolvers/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.
33 34 35 36 |
# File 'app/resolvers/riiif/http_file_resolver.rb', line 33 def initialize(url, = {}) @url = url @options = end |
Instance Attribute Details
#cache_path ⇒ Object (readonly)
Returns the value of attribute cache_path.
32 33 34 |
# File 'app/resolvers/riiif/http_file_resolver.rb', line 32 def cache_path @cache_path end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
32 33 34 |
# File 'app/resolvers/riiif/http_file_resolver.rb', line 32 def url @url end |
Instance Method Details
#basic_auth_credentials ⇒ Object
42 43 44 |
# File 'app/resolvers/riiif/http_file_resolver.rb', line 42 def basic_auth_credentials @options[:basic_auth_credentials] end |
#fetch ⇒ Object
46 47 48 49 |
# File 'app/resolvers/riiif/http_file_resolver.rb', line 46 def fetch download_file unless ::File.exist?(file_name) file_name end |