[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:
parent
152c6b92ac
commit
4194da19c6
|
@ -34,6 +34,13 @@ module Vagrant
|
|||
def has_key?(key)
|
||||
@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)
|
||||
|
|
Loading…
Reference in New Issue