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
- #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
#custom? ⇒ Boolean
17 18 19 |
# File 'lib/madness/theme.rb', line 17 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 |