Class: InnerPlan::Lists::OngoingTasksComponent

Inherits:
Phlex::HTML
  • Object
show all
Defined in:
app/components/inner_plan/lists/ongoing_tasks_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(list, context: nil) ⇒ OngoingTasksComponent

Returns a new instance of OngoingTasksComponent.



3
4
5
6
# File 'app/components/inner_plan/lists/ongoing_tasks_component.rb', line 3

def initialize(list, context: nil)
  @list = list
  @context = context
end

Instance Method Details

#templateObject



8
9
10
11
12
13
14
15
# File 'app/components/inner_plan/lists/ongoing_tasks_component.rb', line 8

def template
  tasks = @list.tasks.ongoing.ordered_by_position
  render(
    InnerPlan::Tasks::RowsComponent.new(tasks, list: @list,
                                               context: @context,
                                               id_key: :ongoing_tasks)
  )
end