this might make more sense as

```ruby
def parse_vpn_connection_names(data, type = :connected)
  connection_names = []
  # this will look for connected vpns when :connected is passed in, otherwise disconnected vpns
  comp_str = type == :connected ? STR_CONNECTED : STR_DISCONNECTED
  data.lines do |line|
    connection_names << line.split('"')[1] if line.start_with?(comp_str)
    # keep in mind my comments about checking the split to see that it worked the way you expected
    # it may be ok to skip the split check if you know it's gonna work when the start_with works too
    # instead of using start_with, you an also use a regex:  if line =~ /^#{comp_str}/
    # regex is harder to read but they are very common and allow you to do much more complex checks and
    # also allow you to easily do case insensitive checks with  if line =~ /^#{comp_str}/i 
  end
  return connection_names
```