Class: WKCheck::Stats
- Inherits:
-
Object
- Object
- WKCheck::Stats
- Defined in:
- lib/wkcheck/stats.rb
Instance Method Summary collapse
Instance Method Details
#level_progression ⇒ Object
17 18 19 20 21 22 |
# File 'lib/wkcheck/stats.rb', line 17 def level_progression progress = Wanikani::Level.progression = Rainbow("Your progress for level #{progress["current_level"]}:\n").green += (progress, "radicals") += (progress, "kanji") end |
#random_kanji ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/wkcheck/stats.rb', line 24 def random_kanji random_kanji = Wanikani::Level.kanji(random_level).sample = Rainbow("Your random kanji is ").bright + Rainbow(random_kanji['character']).bright.underline + "\n" += Rainbow("Level: ").bright + random_kanji['level'].to_s + "\n" += Rainbow("Meaning: ").bright + random_kanji['meaning'] + "\n" += Rainbow("Reading (#{random_kanji['important_reading']}): ").bright + random_kanji[random_kanji['important_reading']] end |
#random_word ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/wkcheck/stats.rb', line 32 def random_word random_word = Wanikani::Level.vocabulary(random_level).sample = Rainbow("Your random word is ").bright + Rainbow(random_word['character']).bright.underline + "\n" += Rainbow("Level: ").bright + random_word['level'].to_s + "\n" += Rainbow("Meaning: ").bright + random_word['meaning'] + "\n" += Rainbow("Reading: ").bright + random_word['kana'] end |
#study_queue ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/wkcheck/stats.rb', line 3 def study_queue if Wanikani::User.on_vacation? user_info = Wanikani::User.information vacation_date = Time.at(user_info["vacation_date"]).localtime.strftime("%A, %B %-d at %-l:%M %p") Rainbow("You are currently on vacation from WaniKani, starting from #{Rainbow(vacation_date).bright}.").green else queue = Wanikani::StudyQueue.queue lessons = queue["lessons_available"] reviews = queue["reviews_available"] next_review_date = Time.at(queue["next_review_date"]).localtime.strftime("%A, %B %-d at %-l:%M %p") (lessons, reviews, next_review_date) end end |