Class: Bable::Index::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bable/index/base.rb

Direct Known Subclasses

Ari, ColemanLiau

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject (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

#calcFloat

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.

Returns:

  • (Float)

    the resulting calculation of the index.



18
19
20
# File 'lib/bable/index/base.rb', line 18

def calc
  fail NotImplementedError
end