def check_exists(required, input)
      required.inject(true) do |result, key|
        input[key] && result
      end
    end
def check_exists(required, input)
      required.inject(true) do |result, key|
        input[key] && result
      end
    end
Required keys must exist in the input hash and must have a non-nil,
 non-empty value.