Class: Cartoonist::RootPath
- Inherits:
-
Object
- Object
- Cartoonist::RootPath
- Defined in:
- lib/cartoonist.rb
Constant Summary collapse
- @@all =
[]
- @@paths =
{}
Class Method Summary collapse
- .[](key) ⇒ Object
- .add(path_name, path) ⇒ Object
- .all ⇒ Object
- .current ⇒ Object
- .current_key ⇒ Object
Class Method Details
.[](key) ⇒ Object
220 221 222 |
# File 'lib/cartoonist.rb', line 220 def [](key) @@paths[key.to_sym] end |
.add(path_name, path) ⇒ Object
215 216 217 218 |
# File 'lib/cartoonist.rb', line 215 def add(path_name, path) (@@all << path_name.to_sym).sort! unless @@all.include? path_name.to_sym @@paths[path_name.to_sym] = path unless @@paths.include? path_name.to_sym end |
.all ⇒ Object
211 212 213 |
# File 'lib/cartoonist.rb', line 211 def all @@all end |
.current ⇒ Object
228 229 230 |
# File 'lib/cartoonist.rb', line 228 def current self[current_key] end |
.current_key ⇒ Object
224 225 226 |
# File 'lib/cartoonist.rb', line 224 def current_key Setting[:root_path] end |