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: dynamodb_basics.rb
    path of file: ./repos/aws-doc-sdk-examples/ruby/example_code/dynamodb/basics
    
    the code of the file until where you have to start completion: # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

require "aws-sdk-dynamodb"
require "json"
require "open-uri"
require "pp"
require "zip"

# snippet-start:[ruby.example_code.ruby.DynamoDBBasics.full]
# snippet-start:[ruby.example_code.ruby.DynamoDBBasics.decl]
class DynamoDBBasics
  attr_reader :dynamo_resource
  attr_reader :table

  def init
    
  def scan_items(year_range)
    movies = []
    scan_hash = {
      filter_expression: "#yr between :start_yr and :end_yr",
      projection_expression: "#yr, title, info.rating",
      expression_attribute_names: {"#yr" => "year"},
      expression_attribute_values: {
        ":start_yr" => year_range[:start], ":end_yr" => year_range[:end]}
    }
    done = false
    start_key = nil
    until done
      scan_hash[:exclusive_start_key] = start_key unless start_key.nil?
      response = @table.scan(scan_hash)
      movies.concat(response.items) unless response.items.empty?
      start_key = response.last_evaluated_key
      done = start_key.nil?
    end
  rescue Aws::DynamoDB::Errors::ServiceError => e
    puts("Couldn't scan for movies. Here's why:")
    puts("\t#{e.code}: #{e.message}")
    raise
  else
    movies
  end