# frozen_string_literal: true module LIT module Builder # @api private # @since 0.1.0 class Map def initialize(mod, key_type, value_type) @type_checker = TypeChecker.new(mod) @key_type = key_type @value_type = value_type end def build type_checker = @type_checker key_type = @key_type value_type = @value_type Class.new(::LIT::Object::Map) do define_method(:check_type!) do |key, value| type_checker.check_type!(key_type, key) type_checker.check_type!(value_type, value) end private(:check_type!) end end end end end