Class: Hobix::SidebarCalendarPlugin

Inherits:
BasePlugin show all
Defined in:
lib/hobix/plugin/calendar.rb

Overview

we just keep parameters from hobix.yaml here

Constant Summary collapse

DIR =
"/calendar"

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasePlugin

inherited, start

Constructor Details

#initialize(weblog, params = {}) ⇒ SidebarCalendarPlugin

Returns a new instance of SidebarCalendarPlugin.



57
58
59
60
61
# File 'lib/hobix/plugin/calendar.rb', line 57

def initialize(weblog, params = {})
  @@start_on_monday = lambda { |x| (x.nil? ? false : x) }[params['start-on-monday']]
  @@point_to_index = (params['point-to-index'] || "monthly").to_sym
  @@day_syms = params['day-symbols'] || (@@start_on_monday ? %w(Mo Tu We Th Fr Sa Su) : %w(Su Mo Tu We Th Fr Sa))
end

Class Method Details

.day_symsObject



65
# File 'lib/hobix/plugin/calendar.rb', line 65

def self.day_syms; @@day_syms; end

.dir_to(date, ext = true) ⇒ Object



68
69
70
# File 'lib/hobix/plugin/calendar.rb', line 68

def self.dir_to(date, ext = true)
  date.strftime("#{DIR}/sidebar-%Y-%m") + (ext ? ".html" : "")
end

.point_to_indexObject



64
# File 'lib/hobix/plugin/calendar.rb', line 64

def self.point_to_index; @@point_to_index; end

.start_on_monday?Boolean

Returns:

  • (Boolean)


63
# File 'lib/hobix/plugin/calendar.rb', line 63

def self.start_on_monday?; @@start_on_monday; end