Class: Avo::Tools::ToolManager
- Inherits:
-
Object
- Object
- Avo::Tools::ToolManager
- Defined in:
- lib/avo/tools/tool_manager.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#get_sidebar_partials ⇒ Object
Insert any partials that we find in app/views/avo/sidebar/items.
- #tool_partials ⇒ Object
- #tools_for_navigation ⇒ Object
Class Method Details
.build ⇒ Object
5 6 7 |
# File 'lib/avo/tools/tool_manager.rb', line 5 def build new end |
Instance Method Details
#get_sidebar_partials ⇒ Object
Insert any partials that we find in app/views/avo/sidebar/items.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/avo/tools/tool_manager.rb', line 11 def .map do |path| File.basename path end .map do |filename| # remove the leading underscore (_) filename[0] = "" # remove the extension filename.gsub!(".html.erb", "") filename end end |
#tool_partials ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/avo/tools/tool_manager.rb', line 29 def tool_partials .map do |filename| segments = filename .gsub(".html.erb", "") .gsub(Rails.root.join("app", "views").to_s, "") .split("/") last_segment = segments.pop.sub("_", "") segments.append last_segment segments.join("/") end end |
#tools_for_navigation ⇒ Object
25 26 27 |
# File 'lib/avo/tools/tool_manager.rb', line 25 def end |