Class: Redmine::Themes::Theme

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/themes.rb

Overview

Class used to represent a theme

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Theme



40
41
42
43
44
# File 'lib/redmine/themes.rb', line 40

def initialize(path)
  @dir = File.basename(path)
  @name = @dir.humanize
  @stylesheets = Dir.glob("#{path}/stylesheets/*.css").collect {|f| File.basename(f).gsub(/\.css$/, '')}
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir



38
39
40
# File 'lib/redmine/themes.rb', line 38

def dir
  @dir
end

#nameObject (readonly)

Returns the value of attribute name



38
39
40
# File 'lib/redmine/themes.rb', line 38

def name
  @name
end

#stylesheetsObject (readonly)

Returns the value of attribute stylesheets



38
39
40
# File 'lib/redmine/themes.rb', line 38

def stylesheets
  @stylesheets
end

Instance Method Details

#<=>(theme) ⇒ Object



49
50
51
# File 'lib/redmine/themes.rb', line 49

def <=>(theme)
  name <=> theme.name
end

#idObject

Directory name used as the theme id



47
# File 'lib/redmine/themes.rb', line 47

def id; dir end