Class: Bable::Index::Base
- Inherits:
-
Object
- Object
- Bable::Index::Base
- Defined in:
- lib/bable/index/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#calc ⇒ Float
The calculation of the readability index.
-
#initialize(text) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(text) ⇒ Base
Returns a new instance of Base.
8 9 10 |
# File 'lib/bable/index/base.rb', line 8 def initialize(text) @text = StatisticString.new(text) end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/bable/index/base.rb', line 6 def text @text end |
Instance Method Details
#calc ⇒ Float
The calculation of the readability index. This method should be implemented in each index class (subclass of Base). The returning value could potentially means different things, depending on the index. Read the documentation of each index for knowing more.
18 19 20 |
# File 'lib/bable/index/base.rb', line 18 def calc fail NotImplementedError end |