Module: ThemerHelper
- Defined in:
- app/helpers/themer_helper.rb
Instance Method Summary collapse
- #set_themer(theme) ⇒ Object
- #themer(theme = nil) ⇒ Object
- #themer_available?(theme) ⇒ Boolean
- #themer_class ⇒ Object
Instance Method Details
#set_themer(theme) ⇒ Object
15 16 17 18 |
# File 'app/helpers/themer_helper.rb', line 15 def set_themer theme [:themer] = theme theme end |
#themer(theme = nil) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'app/helpers/themer_helper.rb', line 3 def themer theme = nil theme ||= [:themer] || Themer.configuration.default if Themer.configuration.auto && theme == 'auto' if Time.now < Time.parse(Themer.configuration.day_time) || Time.now > Time.parse(Themer.configuration.night_time) theme = Themer.configuration.day else theme = Themer.configuration.night end end theme end |
#themer_available?(theme) ⇒ Boolean
28 29 30 |
# File 'app/helpers/themer_helper.rb', line 28 def themer_available? theme Themer.configuration.themes.include? theme end |
#themer_class ⇒ Object
20 21 22 23 24 25 26 |
# File 'app/helpers/themer_helper.rb', line 20 def themer_class begin "themer--#{current_theme}" rescue NoMethodError "themer--#{themer}" end end |