You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: requests_total_items_service.rb
    path of file: ./repos/human-essentials/app/services
    
    the code of the file until where you have to start completion: class RequestsTotalItemsService
  def initialize(requests:)
    @requests = requests
  end

  def calculate
    return unless requests

    request_items_array = []

    request_items.each do |items|
      items.each do |js
    
  def calculate
    return unless requests

    request_items_array = []

    request_items.each do |items|
      items.each do |json|
        request_items_array << [item_name(json['item_id']), json['quantity']]
      end
    end

    request_items_array.inject({}) do |item, (quantity, total)|
      item[quantity] ||= 0
      item[quantity] += total.to_i
      item
    end
  end