Class: Bkblz::V1::DownloadFileByIdRequest
- Defined in:
- lib/bkblz/v1/download_file.rb
Instance Method Summary collapse
- #build_request(session) ⇒ Object
-
#initialize(file_info, byte_range = nil) ⇒ DownloadFileByIdRequest
constructor
A new instance of DownloadFileByIdRequest.
Methods inherited from Request
response_class, #send, url_suffix
Constructor Details
#initialize(file_info, byte_range = nil) ⇒ DownloadFileByIdRequest
Returns a new instance of DownloadFileByIdRequest.
33 34 35 36 |
# File 'lib/bkblz/v1/download_file.rb', line 33 def initialize(file_info, byte_range=nil) @body = {:file_id => file_info.file_id} @byte_range = byte_range end |
Instance Method Details
#build_request(session) ⇒ Object
38 39 40 41 42 |
# File 'lib/bkblz/v1/download_file.rb', line 38 def build_request(session) headers = {} headers[:Range] = "bytes=%d-%d" % @byte_range.minmax if @byte_range session.create_post url(session), @body, headers end |