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: generate-pointer-methods.rb
    path of file: ./repos/truffleruby/tool
    
    the code of the file until where you have to start completion: file = 'src/main/ruby/truffleruby/core/truffle/ffi/pointer_access.rb'

code = <<RUBY
# frozen_string_literal: true

# Copyright (c) 2018, 2024 Oracle and/or its affiliates
    
  def write_array_of_#{type}(ary)
    Truffle::Type.rb_check_type(ary, ::Array)
    check_bounds(0, ary.size * #{SIZEOF[base_type]})
    ary.each_with_index do |value, i|
      Primitive.pointer_write_#{type} address + (i * #{SIZEOF[base_type]}), #{transform.call('value')}
    end
    self
  end