Class: AwsReporting::Store::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-reporting/store.rb

Instance Method Summary collapse

Constructor Details

#initializeCounter

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

#getObject



9
10
11
12
13
14
# File 'lib/aws-reporting/store.rb', line 9

def get
  @mutex.synchronize{
    @counter += 1
    return @counter
  }
end