Class: CustomerRelations::ContactStateCounts

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/models/customer_relations/contact_state_counts.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_user, group, params) ⇒ ContactStateCounts

Returns a new instance of ContactStateCounts.



13
14
15
16
17
# File 'app/models/customer_relations/contact_state_counts.rb', line 13

def initialize(current_user, group, params)
  @current_user = current_user
  @group = group
  @params = params
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



7
8
9
# File 'app/models/customer_relations/contact_state_counts.rb', line 7

def group
  @group
end

Class Method Details

.declarative_policy_classObject



9
10
11
# File 'app/models/customer_relations/contact_state_counts.rb', line 9

def self.declarative_policy_class
  'CustomerRelations::ContactPolicy'
end

Instance Method Details

#allObject



24
25
26
# File 'app/models/customer_relations/contact_state_counts.rb', line 24

def all
  counts.values.sum
end