Module: ActiveFedora::File::Streaming
- Included in:
- ActiveFedora::File
- Defined in:
- lib/active_fedora/file.rb
Defined Under Namespace
Classes: FileBody
Instance Method Summary collapse
-
#authorization_key ⇒ String
Current authorization token from Ldp::Client.
- #headers(range, key, result = Hash.new) ⇒ Hash
-
#stream(range = nil) ⇒ Stream
An object that responds to each.
Instance Method Details
#authorization_key ⇒ String
294 295 296 |
# File 'lib/active_fedora/file.rb', line 294 def self.ldp_source.client.http.headers.fetch("Authorization", nil) end |
#headers(range, key, result = Hash.new) ⇒ Hash
301 302 303 304 305 |
# File 'lib/active_fedora/file.rb', line 301 def headers(range, key, result = Hash.new) result["Range"] = range if range result["Authorization"] = key if key result end |
#stream(range = nil) ⇒ Stream
288 289 290 291 |
# File 'lib/active_fedora/file.rb', line 288 def stream(range = nil) uri = URI.parse(self.uri) FileBody.new(uri, headers(range, )) end |