Method: Vagrant::Util::StringBlockEditor#keys

Defined in:
lib/vagrant/util/string_block_editor.rb

#keys<Array<String>]

This returns the keys (or ids) that are in the string.

Returns:

  • (<Array<String>])

    ]



41
42
43
44
45
46
# File 'lib/vagrant/util/string_block_editor.rb', line 41

def keys
  regexp = /^#\s*VAGRANT-BEGIN:\s*(.+?)$\r?\n?(.*)$\r?\n?^#\s*VAGRANT-END:\s(\1)$/m
  @value.scan(regexp).map do |match|
    match[0]
  end
end