Sha256: 73d3fc274c1b8ea9f4f3aeca71c6c52bbb3af04a980a536109313133627b4731
Contents?: true
Size: 898 Bytes
Versions: 13
Compression:
Stored size: 898 Bytes
Contents
# frozen_string_literal: true module ThinkFeelDoEngine module LessonEvent # Creates a presenter for the logic of the completion data partial class CompletionDataPresenter attr_reader :event, :lesson_module def initialize(event:, lesson_module:) @event = event @lesson_module = lesson_module end def last_page_number_opened event[:last_page_number_opened] end def last_page_opened_at DateTime.iso8601(event[:last_page_opened_at]) end def page_headers event[:page_headers].try do |page_headers| page_headers[2] end end def pretty_title lesson.pretty_title end def selected_at DateTime.iso8601(event[:lesson_selected_at]) end private def lesson lesson_module.find(event[:lesson_id]) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems