Class: Spina::Theme
- Inherits:
-
Object
- Object
- Spina::Theme
- Defined in:
- lib/spina/theme.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
Returns the value of attribute name.
-
#public_theme ⇒ Object
Returns the value of attribute public_theme.
Instance Method Summary collapse
-
#is_custom_undeletable_page?(view_template) ⇒ Boolean
Check if view_template is defined as a custom undeletable page.
- #new_page_templates ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/spina/theme.rb', line 4 def config @config end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/spina/theme.rb', line 4 def name @name end |
#public_theme ⇒ Object
Returns the value of attribute public_theme.
4 5 6 |
# File 'lib/spina/theme.rb', line 4 def public_theme @public_theme end |
Instance Method Details
#is_custom_undeletable_page?(view_template) ⇒ Boolean
Check if view_template is defined as a custom undeletable page
17 18 19 |
# File 'lib/spina/theme.rb', line 17 def is_custom_undeletable_page?(view_template) config.custom_pages.any? { |page| page[:view_template] == view_template && !page[:deletable] } end |
#new_page_templates ⇒ Object
10 11 12 13 14 |
# File 'lib/spina/theme.rb', line 10 def new_page_templates config.view_templates.map do |view_template| [view_template[0], view_template[1][:title], view_template[1][:description], view_template[1][:usage]] unless is_custom_undeletable_page?(view_template[0]) end.compact end |
#to_s ⇒ Object
6 7 8 |
# File 'lib/spina/theme.rb', line 6 def to_s name end |