Class: SplitIoClient::Cache::Repositories::Metrics::MemoryRepository::ValueAndCount
- Inherits:
-
Object
- Object
- SplitIoClient::Cache::Repositories::Metrics::MemoryRepository::ValueAndCount
- Defined in:
- lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb
Overview
small class to act as DTO for gauges
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize ⇒ ValueAndCount
constructor
A new instance of ValueAndCount.
- #set_value(value) ⇒ Object
Constructor Details
#initialize ⇒ ValueAndCount
Returns a new instance of ValueAndCount.
116 117 118 119 |
# File 'lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb', line 116 def initialize @count = 0 @value = 0 end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
113 114 115 |
# File 'lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb', line 113 def count @count end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
114 115 116 |
# File 'lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb', line 114 def value @value end |
Instance Method Details
#clear ⇒ Object
126 127 128 129 |
# File 'lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb', line 126 def clear @count = 0 @value = 0 end |
#set_value(value) ⇒ Object
121 122 123 124 |
# File 'lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb', line 121 def set_value(value) @count += 1 @value = value end |