Ruby class that validates a string
ValidateString is strange name for a class. StringValidator would be more apt.
Don't make your constructor print anything. Your class exists to validate a string, not print things to stdout. Leave that to some other piece of code.
valid should be named valid? and return a boolean. And you can omit the return keyword.
Add attr_reader :string, and replace your @string with just string
8 is a magic number, and should be replaced with constant (e.g. MIN_STRING_LENGTH)
Presumably, this exists to check for simple passwords. However, you're not checking that the string contains both upper- and lowercase letters. An all-uppercase string with a number would pass validation. For passwords, you'd want to enforce that it's mixed casing.


I'd just write a method:

def valid_string?(string)
  return false unless string.length &gt;= 8
  return false unless string =~ /[0-9]/
  return false unless string =~ /[[:upper:]]/ # allows non-Latin letters
  return false unless string =~ /[[:lower:]]/ # ditto
  true
end


Of course, you'd be better off using something like zxcvbn to check password entropy. Your rules allow for the good ol' Password1 string just fine.