lib/mws/orders/collection.rb in mws-orders-0.2.1 vs lib/mws/orders/collection.rb in mws-orders-0.2.2
- old
+ new
@@ -1,6 +1,6 @@
-require "mws/orders/document"
+require 'mws/orders/document'
module MWS
module Orders
class Collection < Document
include Enumerable
@@ -8,22 +8,20 @@
def each
raise NotImplementedError
end
def empty?
- count == 0
+ count.zero?
end
def inspect
- "#<#{self.class} #{
- if count > 3
- "[#{take(3).map(&:inspect).join(', ')}...]"
- else
- "[#{map(&:inspect).join(', ')}]"
- end
- }>"
+ "#<#{self.class} #{if count > 3
+ "[#{take(3).map(&:inspect).join(', ')}...]"
+ else
+ "[#{map(&:inspect).join(', ')}]"
+ end}>"
end
- alias_method :to_s, :inspect
+ alias to_s inspect
end
end
end