Class: Rundown::Processors::ReadingTime
- Inherits:
-
Rundown::Processor
- Object
- Rundown::Processor
- Rundown::Processors::ReadingTime
- Defined in:
- lib/rundown/processors/reading_time.rb
Constant Summary collapse
- RATE =
0.312
Constants inherited from Rundown::Processor
Rundown::Processor::PUNCTUATION
Instance Attribute Summary collapse
-
#reading_rate ⇒ Object
Returns the value of attribute reading_rate.
Attributes inherited from Rundown::Processor
Instance Method Summary collapse
-
#initialize(words, reading_rate = RATE) ⇒ ReadingTime
constructor
A new instance of ReadingTime.
- #process ⇒ Object
Methods inherited from Rundown::Processor
Constructor Details
#initialize(words, reading_rate = RATE) ⇒ ReadingTime
Returns a new instance of ReadingTime.
8 9 10 11 |
# File 'lib/rundown/processors/reading_time.rb', line 8 def initialize(words, reading_rate=RATE) super(words) @reading_rate = reading_rate end |
Instance Attribute Details
#reading_rate ⇒ Object
Returns the value of attribute reading_rate.
6 7 8 |
# File 'lib/rundown/processors/reading_time.rb', line 6 def reading_rate @reading_rate end |
Instance Method Details
#process ⇒ Object
13 14 15 |
# File 'lib/rundown/processors/reading_time.rb', line 13 def process words.size * reading_rate end |