counter2000 0.0.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.
- data/lib/counter2000.rb +27 -0
- metadata +47 -0
data/lib/counter2000.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
class Counter
|
2
|
+
def initialize(label = "Counter")
|
3
|
+
@count = 0; @label = label
|
4
|
+
end
|
5
|
+
|
6
|
+
def click
|
7
|
+
@count += 1
|
8
|
+
end
|
9
|
+
|
10
|
+
def reset
|
11
|
+
@count = 0
|
12
|
+
end
|
13
|
+
|
14
|
+
def count
|
15
|
+
@count
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_s
|
19
|
+
return "#{@label}'s count is #{@count}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def label
|
23
|
+
@label
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: counter2000
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- whm
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-05-06 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: ! "add 1 to a count,\n\t\t\t resets count to zero,\n\t\t\t return
|
15
|
+
current count"
|
16
|
+
email: roblstockton@email.arizona.edu
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/counter2000.rb
|
22
|
+
homepage: http://rubygems.org/gems/counter
|
23
|
+
licenses:
|
24
|
+
- none
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 1.8.28
|
44
|
+
signing_key:
|
45
|
+
specification_version: 3
|
46
|
+
summary: has function of a counter
|
47
|
+
test_files: []
|