lib/burgundy/collection.rb in burgundy-0.3.0 vs lib/burgundy/collection.rb in burgundy-0.4.0
- old
+ new
@@ -1,14 +1,16 @@
+# frozen_string_literal: true
+
module Burgundy
class Collection
def initialize(items, wrapping_class = nil, *args)
@items = items
@wrapping_class = wrapping_class
@args = args
end
- def method_missing(name, *args, &block)
+ def method_missing(name, *args, &block) # rubocop:disable Style/MissingRespondToMissing, Style/MethodMissingSuper
to_ary.send(name, *args, &block)
end
def respond_to?(name, include_all = false)
to_ary.respond_to?(name, include_all)
@@ -19,8 +21,8 @@
@items.map {|item| @wrapping_class.new(item, *@args) }
else
@items.to_a
end
end
- alias_method :to_a, :to_ary
+ alias to_a to_ary
end
end