Class: AwesomeCounterCache::CounterCache

Inherits:
Object
  • Object
show all
Defined in:
lib/awesome_counter_cache/counter_cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column_name:, delta_magnitude:, id:, relation_foreign_key:, relation_name:) ⇒ CounterCache

Returns a new instance of CounterCache.



4
5
6
7
8
9
10
# File 'lib/awesome_counter_cache/counter_cache.rb', line 4

def initialize(column_name:, delta_magnitude:, id:, relation_foreign_key:, relation_name:)
  @column_name = column_name
  @delta_magnitude = delta_magnitude
  @id = id
  @relation_foreign_key = relation_foreign_key
  @relation_name = relation_name
end

Instance Attribute Details

#column_nameObject

Returns the value of attribute column_name.



2
3
4
# File 'lib/awesome_counter_cache/counter_cache.rb', line 2

def column_name
  @column_name
end

#delta_magnitudeObject

Returns the value of attribute delta_magnitude.



2
3
4
# File 'lib/awesome_counter_cache/counter_cache.rb', line 2

def delta_magnitude
  @delta_magnitude
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/awesome_counter_cache/counter_cache.rb', line 2

def id
  @id
end

#relation_foreign_keyObject

Returns the value of attribute relation_foreign_key.



2
3
4
# File 'lib/awesome_counter_cache/counter_cache.rb', line 2

def relation_foreign_key
  @relation_foreign_key
end

#relation_nameObject

Returns the value of attribute relation_name.



2
3
4
# File 'lib/awesome_counter_cache/counter_cache.rb', line 2

def relation_name
  @relation_name
end