Class: AbstractInterface::Theme
- Inherits:
-
Object
- Object
- AbstractInterface::Theme
- Defined in:
- lib/abstract_interface/theme.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #available_layouts_names ⇒ Object
- #layout_definition ⇒ Object
- #layout_definitions ⇒ Object
- #metadata ⇒ Object
Instance Attribute Details
#layout ⇒ Object
5 |
# File 'lib/abstract_interface/theme.rb', line 5 def layout; @layout || 'default' end |
#layout_template ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/abstract_interface/theme.rb', line 7 def layout_template if @layout_template # Check if this template exists exists = layout_definitions.any?{|layout_name, ld| ld['layout_template'] == @layout_template} exists ? @layout_template : 'default' else layout_definition['layout_template'] || 'default' end end |
#name ⇒ Object
4 |
# File 'lib/abstract_interface/theme.rb', line 4 def name; @name || 'default' end |
Instance Method Details
#available_layouts_names ⇒ Object
29 30 31 |
# File 'lib/abstract_interface/theme.rb', line 29 def available_layouts_names layout_definitions.keys end |
#layout_definition ⇒ Object
17 18 19 |
# File 'lib/abstract_interface/theme.rb', line 17 def layout_definition layout_definitions[layout] || layout_definitions['default'] || {} end |
#layout_definitions ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/abstract_interface/theme.rb', line 21 def layout_definitions if AbstractInterface.layouts_defined? AbstractInterface.layout_definitions(name) else {} end end |
#metadata ⇒ Object
33 34 35 |
# File 'lib/abstract_interface/theme.rb', line 33 def AbstractInterface.(name) end |