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-7.6.2 app/helpers/progress_helper.rb
mumuki-laboratory-7.6.1 app/helpers/progress_helper.rb
mumuki-laboratory-7.6.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.5.2 app/helpers/progress_helper.rb
mumuki-laboratory-7.5.1 app/helpers/progress_helper.rb
mumuki-laboratory-7.5.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.4.2 app/helpers/progress_helper.rb
mumuki-laboratory-7.4.1 app/helpers/progress_helper.rb
mumuki-laboratory-7.4.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.3.1 app/helpers/progress_helper.rb
mumuki-laboratory-7.3.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.2.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.1.0 app/helpers/progress_helper.rb
mumuki-laboratory-7.0.12 app/helpers/progress_helper.rb
mumuki-laboratory-7.0.11 app/helpers/progress_helper.rb
mumuki-laboratory-7.0.10 app/helpers/progress_helper.rb
mumuki-laboratory-7.0.9 app/helpers/progress_helper.rb
mumuki-laboratory-7.0.8 app/helpers/progress_helper.rb
mumuki-laboratory-7.0.7 app/helpers/progress_helper.rb
mumuki-laboratory-7.0.6 app/helpers/progress_helper.rb