def extract_lengths(node)
      case node
      when Sass::Tree::PropNode
        extract_lengths(node.value)
      when Sass::Script::Tree::Literal
        extract_lengths_from_string(node.value)
      when String
        extract_lengths_from_string(node)
      when Sass::Script::Tree::Funcall,
           Sass::Tree::MixinNode,
           Sass::Tree::MixinDefNode
        extract_lengths_from_list(*node.args)
      when Sass::Script::Tree::ListLiteral
        extract_lengths_from_list(*node.elements)
      when Sass::Tree::MediaNode
        extract_lengths_from_list(*node.query)
      when Array
        extract_lengths_from_list(*node)
      when Sass::Script::Tree::Interpolation
        extract_lengths_from_list(node.before, node.mid, node.after)
      when Sass::Script::Tree::Operation
        extract_lengths_from_list(node.operand1, node.operand2)
      when Sass::Script::Tree::UnaryOperation
        extract_lengths(node.operand)
      when Sass::Script::Tree::Variable
        nil
      end
    end
def extract_lengths(node)
      case node
      when Sass::Tree::PropNode
        extract_lengths(node.value)
      when Sass::Script::Tree::Literal
        extract_lengths_from_string(node.value)
      when String
        extract_lengths_from_string(node)
      when Sass::Script::Tree::Funcall,
           Sass::Tree::MixinNode,
           Sass::Tree::MixinDefNode
        extract_lengths_from_list(*node.args)
      when Sass::Script::Tree::ListLiteral
        extract_lengths_from_list(*node.elements)
      when Sass::Tree::MediaNode
        extract_lengths_from_list(*node.query)
      when Array
        extract_lengths_from_list(*node)
      when Sass::Script::Tree::Interpolation
        extract_lengths_from_list(node.before, node.mid, node.after)
      when Sass::Script::Tree::Operation
        extract_lengths_from_list(node.operand1, node.operand2)
      when Sass::Script::Tree::UnaryOperation
        extract_lengths(node.operand)
      when Sass::Script::Tree::Variable
        nil
      end
    end
Though long, This method is clear enough in a boring, dispatch kind of way.
 rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/AbcSize