Module: SimpleCalendar::ViewHelpers

Defined in:
lib/simple_calendar/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#calendar(options = {}, &block) ⇒ Object



3
4
5
6
# File 'lib/simple_calendar/view_helpers.rb', line 3

def calendar(options={}, &block)
  raise 'calendar requires a block' unless block_given?
  SimpleCalendar::Calendar.new(self, options).render(&block)
end

#month_calendar(options = {}, &block) ⇒ Object



8
9
10
11
# File 'lib/simple_calendar/view_helpers.rb', line 8

def month_calendar(options={}, &block)
  raise 'month_calendar requires a block' unless block_given?
  SimpleCalendar::MonthCalendar.new(self, options).render(&block)
end

#week_calendar(options = {}, &block) ⇒ Object



13
14
15
16
# File 'lib/simple_calendar/view_helpers.rb', line 13

def week_calendar(options={}, &block)
  raise 'week_calendar requires a block' unless block_given?
  SimpleCalendar::WeekCalendar.new(self, options).render(&block)
end