class Vorpal::Util::ArrayHash
@private
Public Class Methods
new()
click to toggle source
# File lib/vorpal/util/array_hash.rb, line 11 def initialize @hash = Hash.new([]) end
Public Instance Methods
append(key, values)
click to toggle source
# File lib/vorpal/util/array_hash.rb, line 15 def append(key, values) if @hash[key].nil? || @hash[key].empty? @hash[key] = [] end @hash[key].concat(Array(values)) end
pop()
click to toggle source
# File lib/vorpal/util/array_hash.rb, line 22 def pop key = @hash.first.first values = @hash.delete(key) [key, values] end
values()
click to toggle source
# File lib/vorpal/util/array_hash.rb, line 28 def values @hash.values.flatten end