Class: Theme

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_dir) ⇒ Theme

Returns a new instance of Theme.



6
7
8
9
10
11
12
# File 'lib/lokka/theme.rb', line 6

def initialize(root_dir)
  @root_dir = root_dir
  @root_path = '/theme'
  @name = Site.first.theme
  @dir = "#{@root_dir}/#{@name}"
  @path = "#{@root_path}/#{@name}"
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



4
5
6
# File 'lib/lokka/theme.rb', line 4

def dir
  @dir
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/lokka/theme.rb', line 4

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/lokka/theme.rb', line 4

def path
  @path
end

#root_dirObject (readonly)

Returns the value of attribute root_dir.



4
5
6
# File 'lib/lokka/theme.rb', line 4

def root_dir
  @root_dir
end

#root_pathObject (readonly)

Returns the value of attribute root_path.



4
5
6
# File 'lib/lokka/theme.rb', line 4

def root_path
  @root_path
end

Instance Method Details

#to_path(name) ⇒ Object



14
15
16
# File 'lib/lokka/theme.rb', line 14

def to_path(name)
  "#{@dir}/#{name}"
end