Class: Bkblz::V1::FinishLargeFileRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/bkblz/v1/finish_large_file.rb

Instance Method Summary collapse

Methods inherited from Request

response_class, #send, url_suffix

Constructor Details

#initialize(file_id, file_part_infos) ⇒ FinishLargeFileRequest

Returns a new instance of FinishLargeFileRequest.



15
16
17
18
19
20
21
22
23
# File 'lib/bkblz/v1/finish_large_file.rb', line 15

def initialize(file_id, file_part_infos)
  sha1_sums = file_part_infos.sort { |a, b| a.part_number <=> b.part_number }.map do |info|
    info.content_sha1
  end
  @body = {
    :file_id => file_id,
    :part_sha1_array => sha1_sums,
  }
end

Instance Method Details

#build_request(session) ⇒ Object



25
26
27
# File 'lib/bkblz/v1/finish_large_file.rb', line 25

def build_request(session)
  session.create_post url(session), @body
end