Sha256: 2dc90af4fb39cc374e5e7ef770f6145101402b713a3c35961969a990631973be
Contents?: true
Size: 944 Bytes
Versions: 11
Compression:
Stored size: 944 Bytes
Contents
module AbstractInterface class Theme attr_writer :name, :layout_template, :layout def name; @name || 'default' end def layout; @layout || 'default' end 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 def layout_definition layout_definitions[layout] || layout_definitions['default'] || {} end def layout_definitions if AbstractInterface.layouts_defined? AbstractInterface.layout_definitions(name) else {} end end def available_layouts_names layout_definitions.keys end def metadata AbstractInterface.theme_metadata(name) end end end
Version data entries
11 entries across 11 versions & 4 rubygems