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 inherited from Proxying
#failsafe, #initialize, proxying
Constructor Details
This class inherits a constructor from Kredis::Types::Proxying
Instance Attribute Details
#values ⇒ Object
Returns the value of attribute values.
2 3 4 |
# File 'lib/kredis/types/cycle.rb', line 2 def values @values end |
Instance Method Details
#index ⇒ Object
4 |
# File 'lib/kredis/types/cycle.rb', line 4 alias index value |
#next ⇒ Object
10 11 12 |
# File 'lib/kredis/types/cycle.rb', line 10 def next set (index + 1) % values.size end |
#value ⇒ Object
6 7 8 |
# File 'lib/kredis/types/cycle.rb', line 6 def value values[index] end |