Class: RST::Calendar::CalendarEvent
- Inherits:
-
Object
- Object
- RST::Calendar::CalendarEvent
- Includes:
- Eventable, RST::CalendarHelper
- Defined in:
- lib/modules/calendar/calendar_event.rb
Overview
A CalendarEvent happens on a given date and has a label. It can be used in a Calendar
Instance Attribute Summary collapse
-
#event_date ⇒ Object
readonly
Returns the value of attribute event_date.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#event_headline ⇒ Object
override abstract method for an Eventable.
-
#initialize(_date, _label) ⇒ CalendarEvent
constructor
A new instance of CalendarEvent.
Methods included from RST::CalendarHelper
Methods included from Eventable
Constructor Details
#initialize(_date, _label) ⇒ CalendarEvent
Returns a new instance of CalendarEvent.
30 31 32 33 34 |
# File 'lib/modules/calendar/calendar_event.rb', line 30 def initialize(_date,_label) @label = _label @id ||= SecureRandom::hex(4) schedule! parse_date_param(_date) end |
Instance Attribute Details
#event_date ⇒ Object (readonly)
Returns the value of attribute event_date.
23 24 25 |
# File 'lib/modules/calendar/calendar_event.rb', line 23 def event_date @event_date end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23 24 25 |
# File 'lib/modules/calendar/calendar_event.rb', line 23 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
23 24 25 |
# File 'lib/modules/calendar/calendar_event.rb', line 23 def label @label end |
Instance Method Details
#event_headline ⇒ Object
override abstract method for an Eventable
37 38 39 |
# File 'lib/modules/calendar/calendar_event.rb', line 37 def event_headline self.label.to_s.strip end |