Class: Hobix::SidebarCalendarPlugin
- Inherits:
-
BasePlugin
- Object
- BasePlugin
- Hobix::SidebarCalendarPlugin
- 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
- .day_syms ⇒ Object
- .dir_to(date, ext = true) ⇒ Object
- .point_to_index ⇒ Object
- .start_on_monday? ⇒ Boolean
Instance Method Summary collapse
-
#initialize(weblog, params = {}) ⇒ SidebarCalendarPlugin
constructor
A new instance of SidebarCalendarPlugin.
Methods inherited from BasePlugin
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_syms ⇒ Object
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_index ⇒ Object
64 |
# File 'lib/hobix/plugin/calendar.rb', line 64 def self.point_to_index; @@point_to_index; end |
.start_on_monday? ⇒ Boolean
63 |
# File 'lib/hobix/plugin/calendar.rb', line 63 def self.start_on_monday?; @@start_on_monday; end |