lib/nanoc/base/source_data/item_array.rb in nanoc-3.7.4 vs lib/nanoc/base/source_data/item_array.rb in nanoc-3.7.5
- old
+ new
@@ -1,12 +1,10 @@
# encoding: utf-8
module Nanoc
-
# Acts as an array, but allows fetching items using identifiers, e.g. `@items['/blah/']`.
class ItemArray
-
include Enumerable
extend Forwardable
EXCLUDED_METHODS = [
@@ -16,11 +14,11 @@
:instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :respond_to_missing?,
:extend, :display, :method, :public_method, :define_singleton_method, :object_id, :equal?,
:instance_eval, :instance_exec, :__send__, :__id__
]
- DELEGATED_METHODS = (Array.instance_methods + Enumerable.instance_methods).map { |m| m.to_sym } - EXCLUDED_METHODS
+ DELEGATED_METHODS = (Array.instance_methods + Enumerable.instance_methods).map(&:to_sym) - EXCLUDED_METHODS
def_delegators :@items, *DELEGATED_METHODS
def initialize
@items = []
end
@@ -63,9 +61,7 @@
@items.each do |item|
@mapping[item.identifier] = item
end
@mapping.freeze
end
-
end
-
end