Sha256: fec756d78825665cfe445c8f640fa560cf3bb1a1eae048a7e12368abd1631227
Contents?: true
Size: 633 Bytes
Versions: 39
Compression:
Stored size: 633 Bytes
Contents
# frozen_string_literal: true require_relative '../../models/entry_group' module Dsu module Services module EntryGroup class CounterService def initialize(times:, options: {}) raise ArgumentError, 'Argument times is nil' if times.nil? @times = times @options = options end def call total_entry_groups = 0 times.each do |time| total_entry_groups += 1 if Models::EntryGroup.exist?(time: time) end total_entry_groups end private attr_reader :times, :options end end end end
Version data entries
39 entries across 39 versions & 1 rubygems