Sha256: d8ab3235332adfa7cc9c04076d4a989ea175d18fa6971625344d5ba0b02c6b15

Contents?: true

Size: 414 Bytes

Versions: 148

Compression:

Stored size: 414 Bytes

Contents

module ProgressHelper
  def lesson_practice_key_for(stats)
    key_or_default stats, :started?, :continue_lesson, :start_lesson
  end

  def book_practice_key_for(student)
    key_or_default student, :last_exercise, :continue_practicing, :start_practicing
  end

  private

  def key_or_default(object, property, key, default_key)
    if object.try(property)
      key
    else
      default_key
    end
  end
end

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
mumuki-laboratory-9.23.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.22.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.21.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.20.1 app/helpers/progress_helper.rb
mumuki-laboratory-9.20.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.19.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.18.1 app/helpers/progress_helper.rb
mumuki-laboratory-9.18.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.17.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.16.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.15.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.14.1 app/helpers/progress_helper.rb
mumuki-laboratory-9.14.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.13.2 app/helpers/progress_helper.rb
mumuki-laboratory-9.13.1 app/helpers/progress_helper.rb
mumuki-laboratory-9.13.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.12.1 app/helpers/progress_helper.rb
mumuki-laboratory-9.12.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.11.0 app/helpers/progress_helper.rb
mumuki-laboratory-9.10.0 app/helpers/progress_helper.rb