arithmetic_mean_gem 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/ArithmeticMean.rb +8 -0
  3. metadata +42 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d63ac85ac5a6b85cdd715b8ce5c24ff0ad4654adf8113688d7a726210b1d8354
4
+ data.tar.gz: b4fcfad70fb69ba5ce1a4a73e569e926cfb9cb0630261f5934b283b57ddf724a
5
+ SHA512:
6
+ metadata.gz: f59e759514537f46fa1cc51a0d80488aa57a86144113471529d766c526a2272d74e528c1e0a3147f148c84f89de5ce0e9f8fd28d2bbfab518ff462b4fdf8987d
7
+ data.tar.gz: e4cfe66dafd89f855b2188360304fa39462343073c5b78c7b65b61771993c43fe8f11372263cdb26d96ce4fdb4ed658ece5ca5a356b049d7d099c9959709273b
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ArithmeticMean
4
+ def self.average(array_of_numbers)
5
+ return 0 if array_of_numbers.empty?
6
+ array_of_numbers.sum.to_f / array_of_numbers.size
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,42 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arithmetic_mean_gem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Anzhelika Mazurenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/ArithmeticMean.rb
20
+ homepage:
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubygems_version: 3.5.16
39
+ signing_key:
40
+ specification_version: 4
41
+ summary: Calculates the arithmetic mean of the numbers in an array
42
+ test_files: []