keycounter 0.0.9 → 0.1.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/keycounter.rb +9 -0
  3. data/lib/version.rb +12 -0
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3804021867d5d8fd6b66103e8ee6815edc30a96d
4
- data.tar.gz: 0ec851aa154ef59051ec6431137dc53515226757
3
+ metadata.gz: 04aaf90f4b78eb9b9e2f79b239c7f43250cae5a1
4
+ data.tar.gz: f8fbcd67963caed8bf2491864de263d9b3a9d2d7
5
5
  SHA512:
6
- metadata.gz: eabf550fc694ec84c5e97fe52a5ac27ee39a35fc7b62f1b52f3455ff5d67c865fcc4cbb1f3779078f85b312fc5585527802b846adf5c0e9f9de7d8b2837da9ee
7
- data.tar.gz: ef5b02d09f3d7cf8a2d4bcf55dfe3239b633a47755236d8f7ca8cd9c5b875006d4c55b866ac381f2d210ece2ea7434e75604e307497435ebef3686ebf1c26780
6
+ metadata.gz: fbd5e67153569a402ab29956b88e0d31e090258d7fedd1d8edc895e5720b4052c6e774c2e22cccb805bf6142cd78f80f77fff66c14aa76707107961b79da2da3
7
+ data.tar.gz: 3b14e20e839e3e6982e82bb19f29e5431017228d08ca142f9915f460fde80937e9e78d8765e7b3a0f0a849edbe6cad753a854b158b70bcdefa66023906c1d93b
@@ -43,6 +43,11 @@ class Keycounter
43
43
  return valnum
44
44
  end
45
45
 
46
+ # Reset a key to zero
47
+ def keycount_reset(key)
48
+ instance_variable_set("@#{key}", 0)
49
+ end
50
+
46
51
  # Compile in array with the totals of all instance variables
47
52
  def keycount_compile
48
53
  keycounts = Array.new
@@ -65,4 +70,8 @@ class Keycounter
65
70
  instance_variable_set("@#{key}", 0)
66
71
  end
67
72
 
73
+ def keycount_remove(key)
74
+ remove_instance_variable("@#{key}")
75
+ end
76
+
68
77
  end
@@ -0,0 +1,12 @@
1
+
2
+ module Keycounter
3
+
4
+ module VERSION #:nodoc:
5
+ MAJOR = 0
6
+ MINOR = 1
7
+ TINY = 0
8
+ CODENAME = "Onion rings!"
9
+ STRING = [MAJOR, MINOR, TINY].join('.')
10
+ end
11
+
12
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keycounter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Hood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-26 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Counter for reoccuring data using instance variables
14
14
  email: brianh6854@googlemail.com
@@ -18,9 +18,10 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - examples/countries.rb
20
20
  - lib/keycounter.rb
21
+ - lib/version.rb
21
22
  homepage: http://rubygems.org/gems/keycounter
22
23
  licenses:
23
- - MIT
24
+ - BSD
24
25
  metadata: {}
25
26
  post_install_message:
26
27
  rdoc_options: []