Delegate to @flashes with 'delegate' instead of manually.

This commit is contained in:
Ben Orenstein 2011-06-29 15:16:57 -04:00
parent c49d1f2b26
commit 701e8554a8

@ -73,6 +73,8 @@ def notice=(message)
class FlashHash
include Enumerable
delegate :[], :keys, :key?, :empty?, :clear, :each, :to => :@flashes
def initialize #:nodoc:
@used = Set.new
@closed = false
@ -94,24 +96,12 @@ def []=(k, v) #:nodoc:
@flashes[k] = v
end
def [](k)
@flashes[k]
end
def update(h) #:nodoc:
h.keys.each { |k| keep(k) }
@flashes.update h
self
end
def keys
@flashes.keys
end
def key?(name)
@flashes.key? name
end
def delete(key)
@flashes.delete key
self
@ -121,18 +111,6 @@ def to_hash
@flashes.dup
end
def empty?
@flashes.empty?
end
def clear
@flashes.clear
end
def each(&block)
@flashes.each(&block)
end
alias :merge! :update
def replace(h) #:nodoc: