Sha256: aeea24f9039d5dec52224691ac1524223646d398bcf801aecfadcce4117eeba2

Contents?: true

Size: 734 Bytes

Versions: 12

Compression:

Stored size: 734 Bytes

Contents

# frozen_string_literal: true

require_relative '../support/entry_group_fileable'

module Dsu
  module Services
    class EntryGroupReaderService
      include Dsu::Support::EntryGroupFileable

      def initialize(time:, options: {})
        @time = time
        @options = options || {}
      end

      def call
        read_entry_group_file
      end

      class << self
        def entry_group_file_exists?(time:, options: {})
          new(time: time, options: options).send(:entry_group_file_exists?)
        end
      end

      private

      attr_reader :time, :options

      def read_entry_group_file
        return {} unless entry_group_file_exists?

        File.read(entry_group_file_path)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dsu-1.2.1 lib/dsu/services/entry_group_reader_service.rb
dsu-1.2.0 lib/dsu/services/entry_group_reader_service.rb
dsu-1.1.2 lib/dsu/services/entry_group_reader_service.rb
dsu-1.1.1 lib/dsu/services/entry_group_reader_service.rb
dsu-1.1.0.alpha.2 lib/dsu/services/entry_group_reader_service.rb
dsu-1.1.0.alpha.1 lib/dsu/services/entry_group_reader_service.rb
dsu-1.0.0 lib/dsu/services/entry_group_reader_service.rb
dsu-0.1.0.alpha.5 lib/dsu/services/entry_group_reader_service.rb
dsu-0.1.0.alpha.4 lib/dsu/services/entry_group_reader_service.rb
dsu-0.1.0.alpha.3 lib/dsu/services/entry_group_reader_service.rb
dsu-0.1.0.alpha.2 lib/dsu/services/entry_group_reader_service.rb
dsu-0.1.0.alpha.1 lib/dsu/services/entry_group_reader_service.rb