Class: FFFFFF::Counter
- Inherits:
-
Object
- Object
- FFFFFF::Counter
- Defined in:
- lib/0xffffff.rb
Instance Method Summary collapse
- #count_up {|count| ... } ⇒ Object
-
#initialize(path) ⇒ Counter
constructor
A new instance of Counter.
Constructor Details
#initialize(path) ⇒ Counter
Returns a new instance of Counter.
17 18 19 |
# File 'lib/0xffffff.rb', line 17 def initialize(path) @path = Pathname(path) end |
Instance Method Details
#count_up {|count| ... } ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/0xffffff.rb', line 21 def count_up count = read yield count count += 1 write(count) end |