Class: ExceptionHunter::ErrorGroupPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/exception_hunter/error_group_presenter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_group) ⇒ ErrorGroupPresenter

Returns a new instance of ErrorGroupPresenter.



5
6
7
# File 'app/presenters/exception_hunter/error_group_presenter.rb', line 5

def initialize(error_group)
  @error_group = error_group
end

Class Method Details

.format_occurrence_day(day) ⇒ Object



13
14
15
16
# File 'app/presenters/exception_hunter/error_group_presenter.rb', line 13

def self.format_occurrence_day(day)
  date = day.to_date
  date == Date.yesterday ? 'Yesterday' : date.strftime('%A, %B %d')
end

.wrap_collection(collection) ⇒ Object



9
10
11
# File 'app/presenters/exception_hunter/error_group_presenter.rb', line 9

def self.wrap_collection(collection)
  collection.map { |error_group| new(error_group) }
end

Instance Method Details

#show_for_day?(day) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/presenters/exception_hunter/error_group_presenter.rb', line 18

def show_for_day?(day)
  last_occurrence.in_time_zone.to_date == day.to_date
end