Class: ViewAssets::Packager::ActionsMap

Inherits:
Object
  • Object
show all
Defined in:
lib/view_assets/packager/actions_map.rb

Direct Known Subclasses

CssActionsMap, JsActionsMap

Instance Method Summary collapse

Instance Method Details

#retrieveObject

Returns => { :controller1 => [:action1, :action2, ..], ..}.

Returns:

  • > { :controller1 => [:action1, :action2, ..], ..}



5
6
7
8
9
10
11
12
13
14
# File 'lib/view_assets/packager/actions_map.rb', line 5

def retrieve
  action_path.children.select(&:directory?).each_with_object({}) do |controller, action_map|
    all_children = controller.children.map do |action|
      action.basename.to_s.chomp(action.extname)
    end

    controller_name = controller.basename.to_s
    action_map[controller.basename.to_s] = all_children.select { |action| action.to_s != controller_name }
  end
end