Class: PublishingPlatformApi::ContentStore
- Inherits:
-
Base
- Object
- Base
- PublishingPlatformApi::ContentStore
- Defined in:
- lib/publishing_platform_api/content_store.rb
Defined Under Namespace
Classes: ItemNotFound, RedirectResolver, UnresolvedRedirect
Class Method Summary collapse
-
.redirect_for_path(content_item, request_path, request_query = "") ⇒ Object
Returns an array tuple of destination url with status code e.g ["https://www.publishing-platform.co.uk/destination", 301].
Instance Method Summary collapse
Class Method Details
.redirect_for_path(content_item, request_path, request_query = "") ⇒ Object
Returns an array tuple of destination url with status code e.g ["https://www.publishing-platform.co.uk/destination", 301]
21 22 23 |
# File 'lib/publishing_platform_api/content_store.rb', line 21 def self.redirect_for_path(content_item, request_path, request_query = "") RedirectResolver.call(content_item, request_path, request_query) end |
Instance Method Details
#content_item(base_path) ⇒ Object
13 14 15 16 17 |
# File 'lib/publishing_platform_api/content_store.rb', line 13 def content_item(base_path) get_json(content_item_url(base_path)) rescue PublishingPlatformApi::HTTPNotFound => e raise ItemNotFound.build_from(e) end |