[vagrant] Update Registry with #keys method.

This helper method to return the keys for the registry will give capability to eliminate some code. Example:

```ruby
keys = [] 
@subcommands.each { |k,v| keys << k }
keys.sort.each { |k| o.seperator "#{k}" }
```

Versus:

```ruby
@subcommands.keys.sort.each { |k| o.seperator "#{k}" }
```
This commit is contained in:
John Bellone 2013-12-12 09:38:50 -05:00
parent 152c6b92ac
commit 4194da19c6
1 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,13 @@ module Vagrant
@items.has_key?(key)
end
# Returns an array populated with the keys of this object.
#
# @return [Array]
def keys
@items.keys
end
# Iterate over the keyspace.
def each(&block)
@items.each do |key, _|