Class: NOTAM::Schedule::ScheduleArray Abstract
- Inherits:
-
Array
- Object
- Array
- NOTAM::Schedule::ScheduleArray
- Defined in:
- lib/notam/schedule.rb
Overview
This class is abstract.
Instance Method Summary collapse
-
#cover?(object) ⇒ Boolean
Whether the given object is covered by this schedule array.
- #inspect ⇒ String
-
#next ⇒ ScheduleArray
Step through all elements and shift all dates or days to the next day.
- #to_s ⇒ String
Instance Method Details
#cover?(object) ⇒ Boolean
Whether the given object is covered by this schedule array
306 307 308 |
# File 'lib/notam/schedule.rb', line 306 def cover?(object) any? { object.covered_by? _1 } end |
#inspect ⇒ String
292 293 294 |
# File 'lib/notam/schedule.rb', line 292 def inspect %Q(#<#{self.class} #{to_s}>) end |
#next ⇒ ScheduleArray
Step through all elements and shift all dates or days to the next day
313 314 315 316 317 318 319 320 321 |
# File 'lib/notam/schedule.rb', line 313 def next entries.map do |entry| if entry.instance_of? Range (entry.first.next..entry.last.next) else entry.next end end.then { self.class.new(_1) } end |
#to_s ⇒ String
297 298 299 |
# File 'lib/notam/schedule.rb', line 297 def to_s '[' + entries.map { _1.to_s }.join(', ') + ']' end |