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

module GeoPattern
  module StructureGenerators
    class NestedSquaresGenerator < BaseGenerator
      private

      attr_reader :block_size, :square_size

      def after_initialize
        @block_size = map(hex_val(0, 1), 0, 15, 4, 12)
        @square_size = block_size * 7

        self.height = self.width = (sq
    
      def generate_structure
        i = 0
        6.times do |y|
          6.times do |x|
            val = hex_val(i, 1)
            opacity = opacity(val)
            fill = fill_color(val)

            styles = {
              "fill" => "none",
              "stroke" => fill,
              "style" => {
                "opacity" => opacity,
                "stroke-width" => "#{block_size}px"
              }
            }

            svg.rect(x * square_size + x * block_size * 2 + block_size / 2,
              y * square_size + y * block_size * 2 + block_size / 2,
              square_size, square_size, styles)

            val = hex_val(39 - i, 1)
            opacity = opacity(val)
            fill = fill_color(val)

            styles = {
              "fill" => "none",
              "stroke" => fill,
              "style" => {
                "opacity" => opacity,
                "stroke-width" => "#{block_size}px"
              }
            }

            svg.rect(x * square_size + x * block_size * 2 + block_size / 2 + block_size * 2,
              y * square_size + y * block_size * 2 + block_size / 2 + block_size * 2,
              block_size * 3, block_size * 3, styles)
            i += 1
          end
        end

        svg
      end