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-6.4.0 app/helpers/progress_helper.rb
mumuki-laboratory-6.2.0 app/helpers/progress_helper.rb
mumuki-laboratory-6.1.5 app/helpers/progress_helper.rb
mumuki-laboratory-6.0.4 app/helpers/progress_helper.rb
mumuki-laboratory-6.1.4 app/helpers/progress_helper.rb
mumuki-laboratory-6.1.3 app/helpers/progress_helper.rb
mumuki-laboratory-6.0.3 app/helpers/progress_helper.rb
mumuki-laboratory-6.1.2 app/helpers/progress_helper.rb
mumuki-laboratory-6.1.1 app/helpers/progress_helper.rb
mumuki-laboratory-6.1.0 app/helpers/progress_helper.rb
mumuki-laboratory-6.0.2 app/helpers/progress_helper.rb
mumuki-laboratory-6.0.1 app/helpers/progress_helper.rb
mumuki-laboratory-6.0.0 app/helpers/progress_helper.rb
mumuki-laboratory-5.13.0 app/helpers/progress_helper.rb
mumuki-laboratory-5.12.1 app/helpers/progress_helper.rb
mumuki-laboratory-5.12.0 app/helpers/progress_helper.rb
mumuki-laboratory-5.11.0 app/helpers/progress_helper.rb
mumuki-laboratory-5.10.4 app/helpers/progress_helper.rb
mumuki-laboratory-5.10.3 app/helpers/progress_helper.rb
mumuki-laboratory-5.10.2 app/helpers/progress_helper.rb