Sha256: 696f0b61b18d8d2f7d5a861c2f2d40b868b9c4ee6419ddcbeb90023cafd7186f

Contents?: true

Size: 757 Bytes

Versions: 5

Compression:

Stored size: 757 Bytes

Contents

object false
child(:links => "links") do

  # gather index methods of resources
  index_method_description_apis = Apipie.app.resource_descriptions[Apipie.configuration.default_version].map do |name, resource_description|
    if (description = Apipie.app["#{name}#index"])
      description.method_apis_to_json.first
    end
  end.compact

  # add additional actions
  %w(home#status).each do |additional_action|
    if (description = Apipie.app[additional_action]) and
        (api = description.method_apis_to_json.first)
      index_method_description_apis << api
    end
  end

  # render links
  index_method_description_apis.each do |api|
    url, description = api[:api_url], api[:short_description]
    node(description.chomp(".")) { url }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/app/views/api/v1/home/index.json.rabl
foreman_discovery-1.0.0.rc4 test/foreman_app/app/views/api/v1/home/index.json.rabl
foreman_discovery-1.0.0.rc3 test/foreman_app/app/views/api/v1/home/index.json.rabl
foreman_discovery-1.0.0.rc2 test/foreman_app/app/views/api/v1/home/index.json.rabl
foreman_discovery-1.0.0.rc1 test/foreman_app/app/views/api/v1/home/index.json.rabl