def _add_assignment_methods(name, element_method, opts)
      assign_method = opts.delete(:assign_method)
      return unless assign_method

      define_method("#{name}=") do |value|
        return assign_method.call(name, self, value) if assign_method.is_a?(Proc)

        send(element_method).send(assign_method, value)
      end
    end
def _add_assignment_methods(name, element_method, opts)
      assign_method = opts.delete(:assign_method)
      return unless assign_method

      define_method("#{name}=") do |value|
        return assign_method.call(name, self, value) if assign_method.is_a?(Proc)

        send(element_method).send(assign_method, value)
      end
    end
Helper function to reduce perceived complexity of element