Class: Fsrs::ReviewLog
- Inherits:
-
Object
- Object
- Fsrs::ReviewLog
- Defined in:
- lib/fsrs/fsrs.rb
Overview
Review Log
Instance Attribute Summary collapse
-
#elapsed_days ⇒ Object
Returns the value of attribute elapsed_days.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#review ⇒ Object
Returns the value of attribute review.
-
#scheduled_days ⇒ Object
Returns the value of attribute scheduled_days.
-
#state ⇒ Object
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rating, scheduled_days, elapsed_days, review, state) ⇒ ReviewLog
constructor
A new instance of ReviewLog.
- #to_h ⇒ Object
Constructor Details
#initialize(rating, scheduled_days, elapsed_days, review, state) ⇒ ReviewLog
Returns a new instance of ReviewLog.
34 35 36 37 38 39 40 |
# File 'lib/fsrs/fsrs.rb', line 34 def initialize(, scheduled_days, elapsed_days, review, state) @rating = @scheduled_days = scheduled_days @elapsed_days = elapsed_days @review = review @state = state end |
Instance Attribute Details
#elapsed_days ⇒ Object
Returns the value of attribute elapsed_days.
32 33 34 |
# File 'lib/fsrs/fsrs.rb', line 32 def elapsed_days @elapsed_days end |
#rating ⇒ Object
Returns the value of attribute rating.
32 33 34 |
# File 'lib/fsrs/fsrs.rb', line 32 def @rating end |
#review ⇒ Object
Returns the value of attribute review.
32 33 34 |
# File 'lib/fsrs/fsrs.rb', line 32 def review @review end |
#scheduled_days ⇒ Object
Returns the value of attribute scheduled_days.
32 33 34 |
# File 'lib/fsrs/fsrs.rb', line 32 def scheduled_days @scheduled_days end |
#state ⇒ Object
Returns the value of attribute state.
32 33 34 |
# File 'lib/fsrs/fsrs.rb', line 32 def state @state end |
Class Method Details
.from_h(hash) ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/fsrs/fsrs.rb', line 52 def self.from_h(hash) new( hash[:rating], hash[:scheduled_days], hash[:elapsed_days], hash[:review], hash[:state] ) end |
Instance Method Details
#to_h ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/fsrs/fsrs.rb', line 42 def to_h { rating: @rating, scheduled_days: @scheduled_days, elapsed_days: @elapsed_days, review: @review, state: @state } end |