Class: AbstractInterface::Theme

Inherits:
Object
  • Object
show all
Defined in:
lib/abstract_interface/theme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#layoutObject



5
# File 'lib/abstract_interface/theme.rb', line 5

def layout; @layout || 'default' end

#layout_templateObject



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

#nameObject



4
# File 'lib/abstract_interface/theme.rb', line 4

def name; @name || 'default' end

Instance Method Details

#available_layouts_namesObject



29
30
31
# File 'lib/abstract_interface/theme.rb', line 29

def available_layouts_names
  layout_definitions.keys
end

#layout_definitionObject



17
18
19
# File 'lib/abstract_interface/theme.rb', line 17

def layout_definition      
  layout_definitions[layout] || layout_definitions['default'] || {}
end

#layout_definitionsObject



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

#metadataObject



33
34
35
# File 'lib/abstract_interface/theme.rb', line 33

def 
  AbstractInterface.(name)
end