Class: SimplePvr::Model::Schedule
- Inherits:
-
Object
- Object
- SimplePvr::Model::Schedule
- Includes:
- DataMapper::Resource
- Defined in:
- lib/simple_pvr/model/schedule.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.add_exception(options) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/simple_pvr/model/schedule.rb', line 20 def self.add_exception() Schedule.create( type: :exception, title: [:title], channel: [:channel], start_time: [:start_time], end_time: [:end_time]) end |
.add_specification(options) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/simple_pvr/model/schedule.rb', line 11 def self.add_specification() Schedule.create( type: :specification, title: [:title], channel: [:channel], start_time: [:start_time], end_time: [:end_time]) end |
.cleanup ⇒ Object
7 8 9 |
# File 'lib/simple_pvr/model/schedule.rb', line 7 def self.cleanup Schedule.all(:end_time.lt => Time.now).each {|s| s.destroy } end |
Instance Method Details
#end_late_minutes ⇒ Object
60 61 62 |
# File 'lib/simple_pvr/model/schedule.rb', line 60 def end_late_minutes custom_end_late_minutes || 5 end |
#start_early_minutes ⇒ Object
56 57 58 |
# File 'lib/simple_pvr/model/schedule.rb', line 56 def start_early_minutes custom_start_early_minutes || 2 end |