Class: CalendarAssistant::EventSet::Base
- Inherits:
-
Object
- Object
- CalendarAssistant::EventSet::Base
- Defined in:
- lib/calendar_assistant/event_set.rb
Instance Attribute Summary collapse
-
#event_repository ⇒ Object
readonly
Returns the value of attribute event_repository.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
- #==(rhs) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(event_repository, events) ⇒ Base
constructor
A new instance of Base.
- #new(new_events) ⇒ Object
Constructor Details
#initialize(event_repository, events) ⇒ Base
Returns a new instance of Base.
26 27 28 29 |
# File 'lib/calendar_assistant/event_set.rb', line 26 def initialize(event_repository, events) @event_repository = event_repository @events = events end |
Instance Attribute Details
#event_repository ⇒ Object (readonly)
Returns the value of attribute event_repository.
24 25 26 |
# File 'lib/calendar_assistant/event_set.rb', line 24 def event_repository @event_repository end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
24 25 26 |
# File 'lib/calendar_assistant/event_set.rb', line 24 def events @events end |
Instance Method Details
#==(rhs) ⇒ Object
31 32 33 34 |
# File 'lib/calendar_assistant/event_set.rb', line 31 def ==(rhs) return false unless rhs.is_a?(self.class) self.event_repository == rhs.event_repository && self.events == rhs.events end |
#empty? ⇒ Boolean
40 41 42 43 44 |
# File 'lib/calendar_assistant/event_set.rb', line 40 def empty? return true if events.nil? return events.length == 0 if events.is_a?(Enumerable) false end |