Class: Impressionist::UpdateCounters

Inherits:
Object
  • Object
show all
Defined in:
lib/impressionist/update_counters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(receiver) ⇒ UpdateCounters

Returns a new instance of UpdateCounters.



9
10
11
12
# File 'lib/impressionist/update_counters.rb', line 9

def initialize(receiver)
  @receiver = receiver
  @klass = receiver.class
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



7
8
9
# File 'lib/impressionist/update_counters.rb', line 7

def klass
  @klass
end

#receiverObject (readonly)

Returns the value of attribute receiver.



7
8
9
# File 'lib/impressionist/update_counters.rb', line 7

def receiver
  @receiver
end

Instance Method Details

#updateObject



14
15
16
17
# File 'lib/impressionist/update_counters.rb', line 14

def update
  klass.
  update_counters(id, column_name => result)
end