Class: Fsrs::Parameters
- Inherits:
-
Object
- Object
- Fsrs::Parameters
- Defined in:
- lib/fsrs/fsrs.rb
Overview
Parameters
Instance Attribute Summary collapse
-
#maximum_interval ⇒ Object
Returns the value of attribute maximum_interval.
-
#request_retention ⇒ Object
Returns the value of attribute request_retention.
-
#w ⇒ Object
Returns the value of attribute w.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Parameters
constructor
A new instance of Parameters.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Parameters
Returns a new instance of Parameters.
444 445 446 447 448 449 |
# File 'lib/fsrs/fsrs.rb', line 444 def initialize @request_retention = 0.9 @maximum_interval = 36_500 @w = [0.4, 0.6, 2.4, 5.8, 4.93, 0.94, 0.86, 0.01, 1.49, 0.14, 0.94, 2.18, 0.05, 0.34, 1.26, 0.29, 2.61] end |
Instance Attribute Details
#maximum_interval ⇒ Object
Returns the value of attribute maximum_interval.
442 443 444 |
# File 'lib/fsrs/fsrs.rb', line 442 def maximum_interval @maximum_interval end |
#request_retention ⇒ Object
Returns the value of attribute request_retention.
442 443 444 |
# File 'lib/fsrs/fsrs.rb', line 442 def request_retention @request_retention end |
#w ⇒ Object
Returns the value of attribute w.
442 443 444 |
# File 'lib/fsrs/fsrs.rb', line 442 def w @w end |
Class Method Details
.from_h(hash) ⇒ Object
459 460 461 462 463 464 465 |
# File 'lib/fsrs/fsrs.rb', line 459 def self.from_h(hash) params = new params.w = hash[:w] params.request_retention = hash[:request_retention] params.maximum_interval = hash[:maximum_interval] params end |
Instance Method Details
#to_h ⇒ Object
451 452 453 454 455 456 457 |
# File 'lib/fsrs/fsrs.rb', line 451 def to_h { request_retention: @request_retention, maximum_interval: @maximum_interval, w: @w } end |