Method: Betterdocs::Global.sections

Defined in:
lib/betterdocs/global.rb

.sectionsObject



169
170
171
172
173
174
175
176
177
178
# File 'lib/betterdocs/global.rb', line 169

def sections
  @sections and return @sections
  Dir.chdir controllers_dir do
    actions.each_with_object(@sections = {}) do |action, sections|
      sections[action.section] ||= Section.new(action.section)
      sections[action.section] << action
    end
  end
  @sections.freeze
end