make collect/map/reject/select on collections return collections
This commit is contained in:
parent
2a45b5df26
commit
e53d9d34d9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue