lib/chef-api/resources/collection_proxy.rb in chef-infra-api-0.10.0 vs lib/chef-api/resources/collection_proxy.rb in chef-infra-api-0.10.2

- old
+ new

@@ -57,10 +57,11 @@ # @return [Resource::Base, nil] # the fetched class, or nil if it does not exists # def fetch(id) return nil unless exists?(id) + cached(id) { klass.from_url(get(id), prefix) } end # # Determine if the resource with the given id exists on the remote Chef @@ -74,11 +75,11 @@ # # @return [Boolean] # true if the resource exists, false otherwise # def exists?(id) - collection.has_key?(id.to_s) + collection.key?(id.to_s) end # # Get the full list of all entries in the collection. This method is # incredibly expensive and should only be used when you absolutely need @@ -129,12 +130,12 @@ # @return [String] # def inspect objects = collection .map { |id, _| cached(id) || klass.new(klass.schema.primary_key => id) } - .map { |object| object.to_s } + .map(&:to_s) - "#<#{self.class.name} [#{objects.join(', ')}]>" + "#<#{self.class.name} [#{objects.join(", ")}]>" end private attr_reader :collection