lib/sugar-high/array.rb in sugar-high-0.6.2.1 vs lib/sugar-high/array.rb in sugar-high-0.6.3
- old
+ new
@@ -88,11 +88,11 @@
self.extend FilesArray
end
def none?
self.flatten.compact.empty?
- end
+ end unless [].respond_to? :none?
def flat_uniq
self.flatten.compact.uniq
end
@@ -108,10 +108,10 @@
end
# Repeat overall-used method here, to use it without Rails
def extract_options!
last.is_a?(::Hash) ? pop : {}
- end unless defined? Array.new.extract_options!
+ end unless [].respond_to? :extract_options!
end
module MathArray
def sum
inject( 0 ) { |sum,x| sum + x }