Class: FrequencyAnalyser
- Inherits:
-
Struct
- Object
- Struct
- FrequencyAnalyser
- Defined in:
- lib/frequency_analyser/base.rb
Defined Under Namespace
Classes: Aggregation, Aggregator, Counter, Modifier
Instance Attribute Summary collapse
-
#aggregator ⇒ Object
Returns the value of attribute aggregator.
-
#modifier ⇒ Object
Returns the value of attribute modifier.
Class Method Summary collapse
Instance Method Summary collapse
- #analyse(*args) ⇒ Object
-
#initialize(aggregator = Aggregator, modifier = Modifier) ⇒ FrequencyAnalyser
constructor
A new instance of FrequencyAnalyser.
Constructor Details
#initialize(aggregator = Aggregator, modifier = Modifier) ⇒ FrequencyAnalyser
3 4 5 |
# File 'lib/frequency_analyser/base.rb', line 3 def initialize(aggregator = Aggregator, modifier = Modifier) super end |
Instance Attribute Details
#aggregator ⇒ Object
Returns the value of attribute aggregator
1 2 3 |
# File 'lib/frequency_analyser/base.rb', line 1 def aggregator @aggregator end |
#modifier ⇒ Object
Returns the value of attribute modifier
1 2 3 |
# File 'lib/frequency_analyser/base.rb', line 1 def modifier @modifier end |
Class Method Details
.analyse(*args) ⇒ Object
7 8 9 |
# File 'lib/frequency_analyser/base.rb', line 7 def self.analyse(*args) new.analyse(*args) end |
Instance Method Details
#analyse(*args) ⇒ Object
11 12 13 14 15 |
# File 'lib/frequency_analyser/base.rb', line 11 def analyse(*args) files, mode = coerce(args) aggregation = aggregator.aggregate(files) modifier.modify(aggregation, mode) end |