Class: Eventable::OpeningTime
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Eventable::OpeningTime
- Defined in:
- app/models/eventable/opening_time.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.day_selector ⇒ Object
10 11 12 |
# File 'app/models/eventable/opening_time.rb', line 10 def self.day_selector (0..6).to_a.map {|n| [I18n.translate(:'date.day_names')[n],n]} end |
.time_selector ⇒ Object
14 15 16 17 18 |
# File 'app/models/eventable/opening_time.rb', line 14 def self.time_selector (0..48).to_a.map do |n| [to_time_string(n*30), n*30] end end |
Instance Method Details
#after_initialize ⇒ Object
20 21 22 23 |
# File 'app/models/eventable/opening_time.rb', line 20 def after_initialize self.minutes_start ||= 540 self.minutes_end ||= 1080 end |
#closed_at ⇒ Object
29 30 31 |
# File 'app/models/eventable/opening_time.rb', line 29 def closed_at to_time_string(minutes_end) end |
#open_at ⇒ Object
25 26 27 |
# File 'app/models/eventable/opening_time.rb', line 25 def open_at to_time_string(minutes_start) end |