1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

make collection class_eval more consistent

This commit is contained in:
geemus 2011-04-28 22:29:48 -07:00
parent 7620662c87
commit 8be455e4a7

View file

@ -6,19 +6,19 @@ module Fog
Array.public_instance_methods(false).each do |method|
unless [:reject, :select, :slice].include?(method.to_sym)
class_eval <<-RUBY
class_eval <<-EOS, __FILE__, __LINE__
def #{method}(*args)
unless @loaded
lazy_load
end
super
end
RUBY
EOS
end
end
%w[reject select slice].each do |method|
class_eval <<-RUBY
class_eval <<-EOS, __FILE__, __LINE__
def #{method}(*args)
unless @loaded
lazy_load
@ -26,7 +26,7 @@ module Fog
data = super
result = self.clone.clear.concat(data)
end
RUBY
EOS
end
def self.model(new_model=nil)