Class: Calendar

Inherits:
Object
  • Object
show all
Defined in:
app/models/calendar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date) ⇒ Calendar

Returns a new instance of Calendar.



2
3
4
# File 'app/models/calendar.rb', line 2

def initialize(date)
  @date = date
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



14
15
16
# File 'app/models/calendar.rb', line 14

def date
  @date
end

Instance Method Details

#event_stripsObject



10
11
12
# File 'app/models/calendar.rb', line 10

def event_strips
  Event.event_strips_for_month(@date)
end

#eventsObject



6
7
8
# File 'app/models/calendar.rb', line 6

def events
  event_strips.flatten.compact
end