Class: Kredis::Types::Cycle
- Defined in:
- lib/kredis/types/cycle.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
Returns the value of attribute values.
Attributes inherited from Counter
Attributes inherited from Proxying
Instance Method Summary collapse
Methods inherited from Counter
#decrement, #increment, #reset
Methods included from DefaultValues
Methods inherited from Proxying
#failsafe, #initialize, proxying, #unproxied_redis
Instance Attribute Details
#values ⇒ Object
Returns the value of attribute values.
4 5 6 |
# File 'lib/kredis/types/cycle.rb', line 4 def values @values end |
Instance Method Details
#index ⇒ Object
6 |
# File 'lib/kredis/types/cycle.rb', line 6 alias index value |
#next ⇒ Object
12 13 14 |
# File 'lib/kredis/types/cycle.rb', line 12 def next set (index + 1) % values.size end |
#value ⇒ Object
8 9 10 |
# File 'lib/kredis/types/cycle.rb', line 8 def value values[index] end |