frequency_analyser 1.2.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/frequency_analyser/modifier.rb +6 -0
- metadata +4 -4
@@ -11,6 +11,7 @@ class FrequencyAnalyser::Modifier < Struct.new(:aggregation)
|
|
11
11
|
when :percentage
|
12
12
|
percentage
|
13
13
|
else
|
14
|
+
warn_unrecognised(mode) if mode
|
14
15
|
aggregation
|
15
16
|
end
|
16
17
|
end
|
@@ -32,4 +33,9 @@ class FrequencyAnalyser::Modifier < Struct.new(:aggregation)
|
|
32
33
|
@sum ||= aggregation.values.inject(:+)
|
33
34
|
end
|
34
35
|
|
36
|
+
def warn_unrecognised(mode)
|
37
|
+
print "Warning: '#{mode}' is not a recognised mode."
|
38
|
+
puts " (#{__FILE__}:#{__LINE__})"
|
39
|
+
end
|
40
|
+
|
35
41
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frequency_analyser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christopher Patuzzo
|