class TimeBoss::Calendar
Attributes
basis[R]
Public Class Methods
new(basis:)
click to toggle source
# File lib/timeboss/calendar.rb, line 55 def initialize(basis:) @basis = basis end
Private Class Methods
register!()
click to toggle source
# File lib/timeboss/calendar.rb, line 45 def self.register! return unless TimeBoss::Calendars.method_defined?(:register) TimeBoss::Calendars.register(name.to_s.demodulize.underscore, self) end
Public Instance Methods
name()
click to toggle source
Get a name by which this calendar can be referenced. @return [String]
# File lib/timeboss/calendar.rb, line 26 def name self.class.to_s.demodulize.underscore end
Also aliased as: to_s
supports_weeks?()
click to toggle source
Can this calendar support weeks? For custom calendars, this value can generally not be overridden. But for calendars like our Gregorian implementation, weeks are irrelevant, and should be suppressed. @return [Boolean]
# File lib/timeboss/calendar.rb, line 41 def supports_weeks? true end
title()
click to toggle source
Get a friendly title for this calendar. @return [String]
# File lib/timeboss/calendar.rb, line 33 def title name.titleize end
Private Instance Methods
parser()
click to toggle source
# File lib/timeboss/calendar.rb, line 61 def parser @_parser ||= Parser.new(self) end