Class: AwsReporting::Store::Counter
- Inherits:
-
Object
- Object
- AwsReporting::Store::Counter
- Defined in:
- lib/aws-reporting/store.rb
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize ⇒ Counter
constructor
A new instance of Counter.
Constructor Details
#initialize ⇒ Counter
Returns a new instance of Counter.
4 5 6 7 |
# File 'lib/aws-reporting/store.rb', line 4 def initialize @counter = 0 @mutex = Mutex.new end |
Instance Method Details
#get ⇒ Object
9 10 11 12 13 14 |
# File 'lib/aws-reporting/store.rb', line 9 def get @mutex.synchronize{ @counter += 1 return @counter } end |