Class: Redmine::Themes::Theme
- Inherits:
-
Object
- Object
- Redmine::Themes::Theme
- Defined in:
- lib/redmine/themes.rb
Overview
Class used to represent a theme
Instance Attribute Summary
-
- (Object) dir
readonly
Returns the value of attribute dir.
-
- (Object) name
readonly
Returns the value of attribute name.
-
- (Object) stylesheets
readonly
Returns the value of attribute stylesheets.
Instance Method Summary
- - (Object) <=>(theme)
-
- (Object) id
Directory name used as the theme id.
-
- (Theme) initialize(path)
constructor
A new instance of Theme.
Constructor Details
- (Theme) initialize(path)
A new instance of 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
- (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 |