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:
parent
7620662c87
commit
8be455e4a7
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue