Method: Fdoc::MetaServicePresenter#endpoints

Defined in:
lib/fdoc/presenters/meta_service_presenter.rb

#endpointsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/fdoc/presenters/meta_service_presenter.rb', line 33

def endpoints
  if !@endpoints
    @endpoints = []
    prefix = nil

    ungrouped_endpoints.each do |endpoint|
      presenter = presenter_from_endpoint(endpoint)
      current_prefix = presenter.prefix

      @endpoints << [] if prefix != current_prefix
      @endpoints.last << presenter

      prefix = current_prefix
    end
  end

  @endpoints
end