make collect/map/reject/select on collections return collections

This commit is contained in:
geemus (Wesley Beary) 2010-02-23 10:13:51 -08:00
parent 2a45b5df26
commit e53d9d34d9
1 changed files with 9 additions and 0 deletions

View File

@ -10,6 +10,15 @@ module Fog
RUBY
end
%w[collect map reject select].each do |method|
class_eval <<-RUBY
def #{method}(*args)
lazy_load
self.class.new({}).concat(super)
end
RUBY
end
def self._load(marhsalled)
new(Marshal.load(marshalled))
end