Sha256: 58823e732f886190cc2671c5ceb47aacf45519e12b388239b537e7053b826623

Contents?: true

Size: 872 Bytes

Versions: 39

Compression:

Stored size: 872 Bytes

Contents

# frozen_string_literal: true

require_relative '../support/time_formatable'
require_relative 'base_presenter'

module Dsu
  module Presenters
    class EntryGroupPresenter < BasePresenter
      attr_reader :entry_group

      def initialize(entry_group, options: {})
        super

        @entry_group = entry_group
      end

      def formatted_time
        colors = color_theme.date
        apply_theme(Support::TimeFormatable.formatted_time(time: time), theme_color: colors)
      end

      def formatted_errors
        return if valid?

        colors = color_theme.error
        apply_theme(errors.full_messages.join(', '), theme_color: colors)
      end

      def no_entries_available
        header = I18n.t('presenters.entry_group_presenter.headers.no_entries_available')
        apply_theme(header, theme_color: color_theme.info)
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
dsu-3.0.5 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.4 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.3 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.1 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.beta.3 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.beta.2 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.beta.1 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.beta.0 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.12 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.11 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.10 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.9 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.8 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.7 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.6 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.5 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.4 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.3 lib/dsu/presenters/entry_group_presenter.rb
dsu-3.0.0.alpha.2 lib/dsu/presenters/entry_group_presenter.rb