Class: Madness::Theme

Inherits:
Object
  • Object
show all
Defined in:
lib/madness/theme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (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

Returns:

  • (Boolean)


17
18
19
# File 'lib/madness/theme.rb', line 17

def custom?
  @custom ||= (path and Dir.exist? path)
end

#public_pathObject



13
14
15
# File 'lib/madness/theme.rb', line 13

def public_path
  custom? ? "#{path}/public" : File.expand_path('../../app/public', __dir__)
end

#views_pathObject



9
10
11
# File 'lib/madness/theme.rb', line 9

def views_path
  custom? ? "#{path}/views" : File.expand_path('../../app/views', __dir__)
end