Here is a test for when a surface of the form $z = f(x,y)$, where $f$ is a sufficiently smooth function of two variables, is ruled.
To begin, set $II = f_{xx} dx^2 + 2f_{xy}dxdy + f_{yy}dy^2$. If $II$ vanishes identically, then the surface is a plane, so it is ruled.
Suppose that $II$ is nonzero. The discriminant of $II$ is defined to be
$$
\Delta(II) = f_{xx}f_{yy}- {f_{xy}}^2.
$$
If $\Delta(II) >0$, then the surface is locally strictly convex and so cannot be ruled.
If $\Delta(II) = 0$, then the surface is ruled. In fact, it has vanishing Gauss curvature. Moreover, $II = \pm \alpha^2$ for some nonzero $1$-form $\alpha$ on the domain of $f$, and the curves in this domain defined by $\alpha = 0$ (which turn out to be straight lines) lift to the graph $z = f(x,y)$ to be straight lines.
If $\Delta(II) < 0$,
set $III = f_{xxx}\ dx^3+3f_{xxy}\ dx^2dy+3f_{xyy}\ dxdy^2+f_{yyy}\ dy^3$
and let $III_0$ be the $II$-trace-free part of $III$. Then the surface $z = f(x,y)$ is ruled if and only if the discriminant of $III_0$ vanishes.
(Added later: This latter condition turns out to be equivalent to the condition that $II$ and $III$ have a common linear factor, say, $\alpha$, and hence is equivalent to the vanishing of the resultant of $II$ and $III$, i.e., $\textrm{Reslt}(II,III) = 0$. When such an $\alpha$ exists, the leaves of $\alpha=0$ are lines on the surface.)
Notes:
The discriminant of a cubic form $C = p\ dx^3 + 3q\ dx^2dy + 3r\ dxdy^2 + s\ dy^3$ is, by definition,
$$
\Delta(C) = s^2p^2 + 4r^3p + 4 q^3s - 3 r^2q^2 - 6 sqrp.
$$
It is, up to a multiple, the unique polynomial of degree $4$ in the coefficients that vanishes if and only if $C$ has a multiple factor.
Given a quadratic form $Q = a\ dx^2 + 2b\ dxdy + c\ dy^2$ with nonvanishing discriminant $D$, the $Q$-trace of a form $C$ of degree $3$ is the linear form
$$
tr_Q(C ) = \frac{(ar-2bq+cp)\ dx + (as-2br+cq)\ dy}{D}.
$$
Any cubic form $C$ can be uniquely written in the form
$$
C = C_0 + L\cdot Q
$$
where $L$ is a linear form and $tr_Q(C_0) = 0$. (In fact, $L = \tfrac34 tr_Q(C)$.) The term $C_0$ is called the $Q$-trace-free part of $C$.
The resultant $\textrm{Reslt}(Q,C)$ of a quadratic form $Q$ and a cubic form $C$ is the (unique up to nonzero multiples) polynomial that is cubic in the coefficients of $Q$, quadratic in the coefficients of $C$, and vanishes exactly when they have a common linear divisor.