Class: Avo::Tools::ToolManager

Inherits:
Object
  • Object
show all
Defined in:
lib/avo/tools/tool_manager.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.buildObject



5
6
7
# File 'lib/avo/tools/tool_manager.rb', line 5

def build
  new
end

Instance Method Details

#get_sidebar_partialsObject

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 get_sidebar_partials
  Dir.glob(Rails.root.join("app", "views", "avo", "sidebar", "items", "*.html.erb"))
    .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

#tools_for_navigationObject



25
26
27
# File 'lib/avo/tools/tool_manager.rb', line 25

def tools_for_navigation
  get_sidebar_partials
end