Class: Fsrs::CardScheduler
- Inherits:
-
Object
- Object
- Fsrs::CardScheduler
- Defined in:
- lib/fsrs/fsrs.rb
Overview
Determines next review date
Instance Attribute Summary collapse
-
#again ⇒ Object
Returns the value of attribute again.
-
#easy ⇒ Object
Returns the value of attribute easy.
-
#good ⇒ Object
Returns the value of attribute good.
-
#hard ⇒ Object
Returns the value of attribute hard.
Instance Method Summary collapse
-
#initialize(card) ⇒ CardScheduler
constructor
A new instance of CardScheduler.
- #record_log(card, now) ⇒ Object
- #schedule(now, hard_interval, good_interval, easy_interval) ⇒ Object
- #update_state(state) ⇒ Object
Constructor Details
#initialize(card) ⇒ CardScheduler
Returns a new instance of CardScheduler.
68 69 70 71 72 73 |
# File 'lib/fsrs/fsrs.rb', line 68 def initialize(card) @again = card.clone @hard = card.clone @good = card.clone @easy = card.clone end |
Instance Attribute Details
#again ⇒ Object
Returns the value of attribute again.
66 67 68 |
# File 'lib/fsrs/fsrs.rb', line 66 def again @again end |
#easy ⇒ Object
Returns the value of attribute easy.
66 67 68 |
# File 'lib/fsrs/fsrs.rb', line 66 def easy @easy end |
#good ⇒ Object
Returns the value of attribute good.
66 67 68 |
# File 'lib/fsrs/fsrs.rb', line 66 def good @good end |
#hard ⇒ Object
Returns the value of attribute hard.
66 67 68 |
# File 'lib/fsrs/fsrs.rb', line 66 def hard @hard end |
Instance Method Details
#record_log(card, now) ⇒ Object
91 92 93 94 95 96 97 98 |
# File 'lib/fsrs/fsrs.rb', line 91 def record_log(card, now) { Rating::AGAIN => record_again_log(card, now), Rating::HARD => record_hard_log(card, now), Rating::GOOD => record_good_log(card, now), Rating::EASY => record_easy_log(card, now) } end |
#schedule(now, hard_interval, good_interval, easy_interval) ⇒ Object
86 87 88 89 |
# File 'lib/fsrs/fsrs.rb', line 86 def schedule(now, hard_interval, good_interval, easy_interval) update_schedule_days(hard_interval, good_interval, easy_interval) update_due_dates(now, hard_interval, good_interval, easy_interval) end |