Class: Decidim::ActionDelegator::QuestionWithTotals

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/presenters/decidim/action_delegator/question_with_totals.rb

Instance Method Summary collapse

Constructor Details

#initialize(question, questions_by_id) ⇒ QuestionWithTotals

Returns a new instance of QuestionWithTotals.



6
7
8
9
# File 'app/presenters/decidim/action_delegator/question_with_totals.rb', line 6

def initialize(question, questions_by_id)
  super(question)
  @questions_by_id = questions_by_id
end

Instance Method Details

#total_delegatesObject



11
12
13
# File 'app/presenters/decidim/action_delegator/question_with_totals.rb', line 11

def total_delegates
  questions_by_id[id].total_delegates
end

#total_participantsObject



15
16
17
# File 'app/presenters/decidim/action_delegator/question_with_totals.rb', line 15

def total_participants
  questions_by_id[id].total_participants
end