Class: EventCal::Event
- Inherits:
-
Object
- Object
- EventCal::Event
- Defined in:
- lib/event_cal/event.rb
Instance Attribute Summary collapse
-
#held_on ⇒ Object
Returns the value of attribute held_on.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(date = Date.today) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(date = Date.today) ⇒ Event
Returns a new instance of Event.
5 6 7 |
# File 'lib/event_cal/event.rb', line 5 def initialize(date = Date.today) @held_on = date end |
Instance Attribute Details
#held_on ⇒ Object
Returns the value of attribute held_on.
4 5 6 |
# File 'lib/event_cal/event.rb', line 4 def held_on @held_on end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/event_cal/event.rb', line 4 def name @name end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/event_cal/event.rb', line 9 def self.all [] end |
.fetch_events(calendar) ⇒ Object
13 14 15 16 17 |
# File 'lib/event_cal/event.rb', line 13 def self.fetch_events(calendar) all.select do |event| (calendar.start_on .. calendar.end_on).include?(event.held_on) end end |