Class: Counter::Cache::Counters::BufferCounter::Updater

Inherits:
Struct
  • Object
show all
Defined in:
lib/counter/cache/counters/buffer_counter/updater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#counter_class_nameObject

Returns the value of attribute counter_class_name

Returns:

  • (Object)

    the current value of counter_class_name



9
10
11
# File 'lib/counter/cache/counters/buffer_counter/updater.rb', line 9

def counter_class_name
  @counter_class_name
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



9
10
11
# File 'lib/counter/cache/counters/buffer_counter/updater.rb', line 9

def options
  @options
end

#source_objectObject

Returns the value of attribute source_object

Returns:

  • (Object)

    the current value of source_object



9
10
11
# File 'lib/counter/cache/counters/buffer_counter/updater.rb', line 9

def source_object
  @source_object
end

Instance Method Details

#update!(direction) ⇒ Object



10
11
12
13
14
15
# File 'lib/counter/cache/counters/buffer_counter/updater.rb', line 10

def update!(direction)
  return unless valid?
  incr if direction == :incr
  decr if direction == :decr
  enqueue
end