Class: Landable::ApiController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Landable::ApiController
- Defined in:
- app/controllers/landable/api_controller.rb
Direct Known Subclasses
Landable::Api::AccessTokensController, Landable::Api::AssetsController, Landable::Api::AuditsController, Landable::Api::CategoriesController, Landable::Api::ConfigurationsController, Landable::Api::DirectoriesController, Landable::Api::PageRevisionsController, Landable::Api::PagesController, Landable::Api::TemplateRevisionsController, Landable::Api::TemplatesController, Landable::Api::ThemesController
Constant Summary collapse
- API_MEDIA_REGEX =
here’s looking at you, developer.github.com/v3/media/ mime type matching is still handled by rails - see lib/landable/mime_types.rb
/^application\/vnd\.landable(\.v(?<version>[\w\-]+))?(\.(?<param>(?:[\w\-]+)))?(\+(?<format>[\w\-]+))?/
Instance Method Summary collapse
Instance Method Details
#api_media ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'app/controllers/landable/api_controller.rb', line 49 def api_media @api_media ||= begin accept = request.headers['Accept'].match(API_MEDIA_REGEX) || {} { version: Landable::VERSION::STRING, format: request.format.symbol, param: accept['param'].presence, } end end |