Class: TopicsController

Inherits:
Object
  • Object
show all
Defined in:
lib/dbc_today/controllers/topics_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTopicsController

Returns a new instance of TopicsController.



7
8
9
# File 'lib/dbc_today/controllers/topics_controller.rb', line 7

def initialize
  @view = TopicsView.new
end

Instance Attribute Details

#viewObject (readonly)

Returns the value of attribute view.



5
6
7
# File 'lib/dbc_today/controllers/topics_controller.rb', line 5

def view
  @view
end

Instance Method Details

#show_topics(phase, week, day) ⇒ Object



11
12
13
14
# File 'lib/dbc_today/controllers/topics_controller.rb', line 11

def show_topics(phase, week, day)
  topics = Topic.where(phase: phase, week: week, day: day)
  view.display(topics)
end