Class: EventCal::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/event_cal/event.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_onObject

Returns the value of attribute held_on


4
5
6
# File 'lib/event_cal/event.rb', line 4

def held_on
  @held_on
end

#nameObject

Returns the value of attribute name


4
5
6
# File 'lib/event_cal/event.rb', line 4

def name
  @name
end

Class Method Details

.allObject


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