Class: Madness::Theme
- Inherits:
-
Object
- Object
- Madness::Theme
- Defined in:
- lib/madness/theme.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #css_source_path ⇒ Object
- #css_target_path ⇒ Object
- #custom? ⇒ Boolean
-
#initialize(path = nil) ⇒ Theme
constructor
A new instance of Theme.
- #public_path ⇒ Object
- #views_path ⇒ Object
Constructor Details
#initialize(path = nil) ⇒ Theme
Returns a new instance of Theme.
5 6 7 |
# File 'lib/madness/theme.rb', line 5 def initialize(path=nil) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/madness/theme.rb', line 3 def path @path end |
Instance Method Details
#css_source_path ⇒ Object
17 18 19 |
# File 'lib/madness/theme.rb', line 17 def css_source_path custom? ? "#{path}/styles" : 'app/styles' end |
#css_target_path ⇒ Object
21 22 23 |
# File 'lib/madness/theme.rb', line 21 def css_target_path custom? ? "#{path}/public/css" : 'app/public/css' end |
#custom? ⇒ Boolean
25 26 27 |
# File 'lib/madness/theme.rb', line 25 def custom? @custom ||= (path and Dir.exist? path) end |
#public_path ⇒ Object
13 14 15 |
# File 'lib/madness/theme.rb', line 13 def public_path custom? ? "#{path}/public" : File.('../../app/public', __dir__) end |
#views_path ⇒ Object
9 10 11 |
# File 'lib/madness/theme.rb', line 9 def views_path custom? ? "#{path}/views" : File.('../../app/views', __dir__) end |