Class: Theme
- Inherits:
-
Object
- Object
- Theme
- Defined in:
- lib/theme_support/theme.rb
Constant Summary collapse
- @@cache_theme_lookup =
false
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#preview_image ⇒ Object
Returns the value of attribute preview_image.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #has_preview? ⇒ Boolean
-
#initialize(name) ⇒ Theme
constructor
A new instance of Theme.
Constructor Details
#initialize(name) ⇒ Theme
Returns a new instance of Theme.
7 8 9 10 11 |
# File 'lib/theme_support/theme.rb', line 7 def initialize(name) @name = name @title = name.underscore.humanize.titleize @description_html = nil end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/theme_support/theme.rb', line 5 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/theme_support/theme.rb', line 5 def name @name end |
#preview_image ⇒ Object
Returns the value of attribute preview_image.
5 6 7 |
# File 'lib/theme_support/theme.rb', line 5 def preview_image @preview_image end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/theme_support/theme.rb', line 5 def title @title end |
Class Method Details
.find_all ⇒ Object
28 29 30 31 32 |
# File 'lib/theme_support/theme.rb', line 28 def self.find_all installed_themes.inject([]) do |array, path| array << theme_from_path(path) end end |
Instance Method Details
#has_preview? ⇒ Boolean
20 21 22 |
# File 'lib/theme_support/theme.rb', line 20 def has_preview? File.exists?( File.join( Theme.path_to_theme(name), 'images', 'preview.png' ) ) rescue false end |