Sha256: 3c74fca3c343dc96f953dc14e2c30cc1ffc5afe08de85c2fe53c5543312e4275
Contents?: true
Size: 412 Bytes
Versions: 9
Compression:
Stored size: 412 Bytes
Contents
# frozen_string_literal: true module ActionTracker class RecordsCollection < Array def select_by(path, value) keys = path.to_s.split('.').map(&:to_sym) items = select do |item| item.dig(*keys) == value end self.class.new items end def last_event last.dig(:payload, :event) end def last_content last.dig(:payload, :content) end end end
Version data entries
9 entries across 9 versions & 1 rubygems