Class: ThemesForRails::Config
- Inherits:
-
Object
- Object
- ThemesForRails::Config
- Defined in:
- lib/themes_for_rails/config.rb
Instance Attribute Summary collapse
- #base_dir ⇒ Object
- #themes_dir ⇒ Object
-
#use_sass ⇒ Object
Returns the value of attribute use_sass.
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize(&block) ⇒ Config
constructor
A new instance of Config.
- #sass_is_available? ⇒ Boolean
- #themes_path ⇒ Object
- #use_sass? ⇒ Boolean
Constructor Details
#initialize(&block) ⇒ Config
Returns a new instance of Config.
7 8 9 10 |
# File 'lib/themes_for_rails/config.rb', line 7 def initialize(&block) @use_sass = true yield if block_given? end |
Instance Attribute Details
#base_dir ⇒ Object
12 13 14 |
# File 'lib/themes_for_rails/config.rb', line 12 def base_dir @base_dir ||= Rails.root end |
#themes_dir ⇒ Object
16 17 18 |
# File 'lib/themes_for_rails/config.rb', line 16 def themes_dir @themes_dir ||= "themes" end |
#use_sass ⇒ Object
Returns the value of attribute use_sass.
5 6 7 |
# File 'lib/themes_for_rails/config.rb', line 5 def use_sass @use_sass end |
Instance Method Details
#clear ⇒ Object
24 25 26 27 |
# File 'lib/themes_for_rails/config.rb', line 24 def clear @base_dir = nil @themes_dir = nil end |
#sass_is_available? ⇒ Boolean
33 34 35 |
# File 'lib/themes_for_rails/config.rb', line 33 def sass_is_available? !!defined?Sass::Plugin end |
#themes_path ⇒ Object
20 21 22 |
# File 'lib/themes_for_rails/config.rb', line 20 def themes_path File.join(base_dir, themes_dir) end |
#use_sass? ⇒ Boolean
29 30 31 |
# File 'lib/themes_for_rails/config.rb', line 29 def use_sass? @use_sass and sass_is_available? end |