to_histogram 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa1cb2265ca6164d3b0f7dd6292c1d499bfe0488
4
- data.tar.gz: 7631a5d5fa1138dc8c606ea20796bd6728d8834b
3
+ metadata.gz: a4478baf8c93b742601adc04a6c7828a3abba17c
4
+ data.tar.gz: 2664f02f676edc3069ff6366595971537cf6d8c9
5
5
  SHA512:
6
- metadata.gz: e5c41cd8733f140379ce4eadd116bd217549faef6e89ab6934374bae82a708def16b361015678b9d8fb896c6d5564577dd9ab84e3618e98e02b7708e59416c19
7
- data.tar.gz: 426f7996e9e59fcccff17e8fa7d479b550b2f4367cb9ef6cfef45081dd780f5580f48260c4bb55c39c140d2045106aa380993742682796792ffcae094ca77df4
6
+ metadata.gz: 3bd0b390d987fd206f9e3f064f85e575404c40dc5934b73ca34a62350c9be406b25eef9da3926dab9d0ab72130d5ea572ac06d9454b7c4241ace97e6ff98f3b5
7
+ data.tar.gz: aa761627dba1416ad3f9d891ddd2daa9d7b9aae0de28bd72b837dd308b83a4d489a0c869148dbf84966a215e3faf9be0d702b44cd52a4dc2fa7606ca938f2fe0
data/lib/histogram.rb CHANGED
@@ -28,5 +28,9 @@ module ToHistogram
28
28
  return @buckets.length
29
29
  end
30
30
 
31
+ def inspect
32
+ return "class: #{self.class} object_id: #{self.object_id}"
33
+ end
34
+
31
35
  end
32
36
  end
data/lib/stdout_print.rb CHANGED
@@ -15,7 +15,7 @@ module ToHistogram
15
15
  private
16
16
  def print_header
17
17
  puts "\n**************************************************************"
18
- puts "Results for #to_histogram(num_buckets: #{@histogram.num_buckets}, percentile: #{@histogram.percentile})"
18
+ puts "Results for #to_histogram(num_buckets: #{@histogram.num_buckets}, percentile: #{@histogram.percentile}, print_info: true)"
19
19
  puts "\n"
20
20
  puts "Min Value: #{@original_array[0]}, Max Value: #{@original_array[-1]}"
21
21
  puts "Mean: #{mean}, Median: #{median}, Mode: #{mode}"
data/lib/to_histogram.rb CHANGED
@@ -2,13 +2,12 @@ require_relative './histogram'
2
2
  require_relative './stdout_print'
3
3
 
4
4
  class Array
5
- def to_histogram(num_buckets: 10, percentile: 100)
5
+ def to_histogram(num_buckets: 10, percentile: 100, print_info: true)
6
6
  histogram = ToHistogram::Histogram.new(self, num_buckets, percentile)
7
7
  stdout_print = ToHistogram::StdoutPrint.new(histogram, self)
8
8
 
9
- stdout_print.invoke
9
+ stdout_print.invoke if print_info
10
10
 
11
- puts "\n\n"
12
- return nil
11
+ return histogram
13
12
  end
14
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_histogram
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Sykes