array_op_custom 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc7c3faafe3980d5c93286b570357a6b84fa2c11b5be808df8bd87d4f3743e8b
4
- data.tar.gz: 82d40876da3efc14b40cf9d5b3802de083276a89fe976fe591a891eb878d6d6c
3
+ metadata.gz: d6ddd99e98812610553b9562774e458fc9d180d36777d1c56a8c382c0e881832
4
+ data.tar.gz: f7ce57877214e3e0ccc117495b454c474f97389827ebce6a5f4d49460aeb4fe8
5
5
  SHA512:
6
- metadata.gz: 3ab7f340313a5993b9c8911b037d8d2756a01f8eb1e317a0f58a7929945c911d8fb2784f5eae4147dcb6fafdcbf923d53ffa1398bed826d074a79ed7cbc0aff5
7
- data.tar.gz: 00226f84499da84d828993d658ac9f0c67a4ce0bd723bd6d045766e914cea0791359b7a483c1b414622ff9dbf27acbf09ffa19f3fa3044dc5ae9be2f148ebda9
6
+ metadata.gz: 7c8561feba238ba0fcc6ec3e63ed9388ddd19c98a0e99088465df5cbf1eef4cca36da03f3b02b965e08b8ed9fbd4348c51cde5fccea6bf28ef01c37eb5a51482
7
+ data.tar.gz: c94638a9efcb81e78e5decfb9c4439d9229364684a15b55fa6fd0586e1d4fc7c857fd2b36c3ae1543fd5d5413ab45c31f0d3713ba150eb75d22e5d81e330e301
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- array_op_custom (0.1.0)
4
+ array_op_custom (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -69,9 +69,13 @@ require 'array_op_custom'
69
69
  [1, 2, 3].to_s
70
70
  #=> ["1", "2", "3"]
71
71
 
72
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].sum
73
+ #=> 55
74
+
72
75
  ["1", "2", "3"].to_i
73
76
  #=> [1, 2, 3]
74
77
 
75
78
  [1, 2, 3].to_h
76
79
  #=> {:"0"=>1, :"1"=>2, :"2"=>3}
80
+
77
81
  ```
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  Custom array's operator
14
14
  "+", "-" and "*".
15
15
  add method
16
- to_s, to_i, to_h.
16
+ to_s, to_i, to_h, sum.
17
17
  DESC
18
18
  spec.homepage = "https://github.com/k-kyg/ruby_array_op_custom"
19
19
  spec.license = "MIT"
@@ -39,5 +39,8 @@ class Array
39
39
  h[b.to_s.to_sym] = a
40
40
  end
41
41
  return h
42
+ end
43
+ def sum
44
+ self.reduce{|a, b| a + b}
42
45
  end
43
46
  end
@@ -1,3 +1,3 @@
1
1
  module ArrayOpCustom
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array_op_custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-kyg
@@ -56,7 +56,7 @@ description: |
56
56
  Custom array's operator
57
57
  "+", "-" and "*".
58
58
  add method
59
- to_s, to_i, to_h.
59
+ to_s, to_i, to_h, sum.
60
60
  email:
61
61
  - ''
62
62
  executables: []