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

- (Theme) initialize(path)



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

- (Object) dir (readonly)

Returns the value of attribute dir



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

def dir
  @dir
end

- (Object) name (readonly)

Returns the value of attribute name



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

def name
  @name
end

- (Object) stylesheets (readonly)

Returns the value of attribute stylesheets



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

def stylesheets
  @stylesheets
end

Instance Method Details

- (Object) <=>(theme)



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

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

- (Object) id

Directory name used as the theme id



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

def id; dir end