Class: EventsController

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEventsController

Returns a new instance of EventsController.



8
9
10
# File 'lib/dbc_today/controllers/events_controller.rb', line 8

def initialize
  @view = EventsView.new
end

Instance Attribute Details

#viewObject (readonly)

Returns the value of attribute view.



6
7
8
# File 'lib/dbc_today/controllers/events_controller.rb', line 6

def view
  @view
end

Instance Method Details

#show_schedule(phase, week, day) ⇒ Object



12
13
14
15
# File 'lib/dbc_today/controllers/events_controller.rb', line 12

def show_schedule(phase, week, day)
  events = Event.where(phase: phase, week: week, day: day)
  view.display(events)
end