Class: RiakDt::Counter
- Inherits:
-
Object
- Object
- RiakDt::Counter
- Defined in:
- lib/riak-dt-ruby/counter.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #decrement ⇒ Object
- #increment ⇒ Object
-
#initialize(name) ⇒ Counter
constructor
A new instance of Counter.
- #value ⇒ Object
Constructor Details
#initialize(name) ⇒ Counter
Returns a new instance of Counter.
4 5 6 7 |
# File 'lib/riak-dt-ruby/counter.rb', line 4 def initialize(name) self.name = name @encoded_name = CGI.escape name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/riak-dt-ruby/counter.rb', line 3 def name @name end |
Instance Method Details
#decrement ⇒ Object
14 15 16 17 |
# File 'lib/riak-dt-ruby/counter.rb', line 14 def decrement RiakDt.client.post "/counters/#{@encoded_name}/decrement" nil end |