Class: DDMetrics::BasicCounter
- Inherits:
-
Object
- Object
- DDMetrics::BasicCounter
- Defined in:
- lib/ddmetrics/basic_counter.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #increment ⇒ Object
-
#initialize ⇒ BasicCounter
constructor
A new instance of BasicCounter.
Constructor Details
#initialize ⇒ BasicCounter
Returns a new instance of BasicCounter.
7 8 9 |
# File 'lib/ddmetrics/basic_counter.rb', line 7 def initialize @value = 0 end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/ddmetrics/basic_counter.rb', line 5 def value @value end |
Instance Method Details
#increment ⇒ Object
11 12 13 |
# File 'lib/ddmetrics/basic_counter.rb', line 11 def increment @value += 1 end |