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.0.5 app/helpers/progress_helper.rb
mumuki-laboratory-9.0.4 app/helpers/progress_helper.rb
mumuki-laboratory-9.0.3 app/helpers/progress_helper.rb
mumuki-laboratory-9.0.2 app/helpers/progress_helper.rb
mumuki-laboratory-9.0.1 app/helpers/progress_helper.rb
mumuki-laboratory-9.0.0 app/helpers/progress_helper.rb
mumuki-laboratory-8.6.1 app/helpers/progress_helper.rb
mumuki-laboratory-8.6.0 app/helpers/progress_helper.rb
mumuki-laboratory-8.5.0 app/helpers/progress_helper.rb
mumuki-laboratory-8.4.0 app/helpers/progress_helper.rb
mumuki-laboratory-8.3.0 app/helpers/progress_helper.rb
mumuki-laboratory-8.2.1 app/helpers/progress_helper.rb
mumuki-laboratory-8.2.0 app/helpers/progress_helper.rb
mumuki-laboratory-8.1.3 app/helpers/progress_helper.rb
mumuki-laboratory-8.1.2 app/helpers/progress_helper.rb
mumuki-laboratory-8.1.1 app/helpers/progress_helper.rb
mumuki-laboratory-8.1.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.12.3 app/helpers/progress_helper.rb
mumuki-laboratory-8.0.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.12.1 app/helpers/progress_helper.rb