keycounter 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/keycounter.rb +9 -0
- data/lib/version.rb +12 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04aaf90f4b78eb9b9e2f79b239c7f43250cae5a1
|
4
|
+
data.tar.gz: f8fbcd67963caed8bf2491864de263d9b3a9d2d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbd5e67153569a402ab29956b88e0d31e090258d7fedd1d8edc895e5720b4052c6e774c2e22cccb805bf6142cd78f80f77fff66c14aa76707107961b79da2da3
|
7
|
+
data.tar.gz: 3b14e20e839e3e6982e82bb19f29e5431017228d08ca142f9915f460fde80937e9e78d8765e7b3a0f0a849edbe6cad753a854b158b70bcdefa66023906c1d93b
|
data/lib/keycounter.rb
CHANGED
@@ -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
|
data/lib/version.rb
ADDED
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
|
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:
|
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
|
-
-
|
24
|
+
- BSD
|
24
25
|
metadata: {}
|
25
26
|
post_install_message:
|
26
27
|
rdoc_options: []
|