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: object.rb
    path of file: ./repos/shale/lib/shale/schema/json_generator
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require_relative 'base'

module Shale
  module Schema
    class JSONGenerator
      # Class representing JSON Schema object type
      #
      # @api private
      class Object < Base
        # Initialize object
        #
        # @param [String] name
        # @param [
        #   Array<Shale::Schema::JSONGenerator::Base,
        #   Sh
    
        def as_type
          required_props = @properties.filter_map { |prop| prop.name if prop&.schema&.[](:required) }

          {
            'type' => 'object',
            'properties' => @properties.to_h { |el| [el.name, el.as_json] },
            'required' => required_props.empty? ? nil : required_props,
            'minProperties' => @root[:min_properties],
            'maxProperties' => @root[:max_properties],
            'dependentRequired' => @root[:dependent_required],
          }.compact
        end