Module: Rooftop
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/rooftop/hook_calls.rb,
lib/rooftop.rb,
lib/rooftop/base.rb,
lib/rooftop/page.rb,
lib/rooftop/post.rb,
lib/rooftop/client.rb,
lib/rooftop/nested.rb,
lib/rooftop/scopes.rb,
lib/rooftop/preview.rb,
lib/rooftop/version.rb,
lib/rooftop/coercions.rb,
lib/rooftop/menus/item.rb,
lib/rooftop/menus/menu.rb,
lib/rooftop/pagination.rb,
lib/rooftop/content/field.rb,
lib/rooftop/field_aliases.rb,
lib/rooftop/models/author.rb,
lib/rooftop/models/taxonomy.rb,
lib/rooftop/queries/queries.rb,
lib/rooftop/models/media_item.rb,
lib/rooftop/content/collection.rb,
lib/rooftop/middleware/headers.rb,
lib/rooftop/resource_links/link.rb,
lib/rooftop/models/taxonomy_term.rb,
lib/rooftop/content/content_fields.rb,
lib/rooftop/coercions/title_coercion.rb,
lib/rooftop/coercions/author_coercion.rb,
lib/rooftop/coercions/parent_coercion.rb,
lib/rooftop/resource_links/collection.rb,
lib/rooftop/errors/preview_key_mismatch.rb,
lib/rooftop/middleware/debug_middleware.rb,
lib/rooftop/middleware/embed_middleware.rb,
lib/rooftop/errors/field_not_found_error.rb,
lib/rooftop/errors/unmapped_object_error.rb,
lib/rooftop/errors/record_not_found_error.rb,
lib/rooftop/resource_links/resource_links.rb,
lib/rooftop/errors/unresolveable_link_error.rb,
lib/rooftop/middleware/pagination_middleware.rb,
lib/rooftop/middleware/record_not_found_middleware.rb
Overview
This is a bit hacky. It looks like Her.rb strips querystrings with an underscore, and WP requires ‘?_embed’ in order to embed child links. We look for a query param called ‘embed’ and change it to _embed (as well as sending the original)
Defined Under Namespace
Modules: Base, Client, Coercions, Content, FieldAliases, HookCalls, Menus, Nested, Page, Pagination, Post, Preview, Queries, ResourceLinks, Scopes Classes: Author, Configuration, DebugMiddleware, EmbedMiddleware, Headers, MediaItem, PaginationMiddleware, RecordNotFoundError, RecordNotFoundMiddleware, Taxonomy, TaxonomyTerm
Constant Summary collapse
- DEFAULT_API_NAMESPACE =
"wp"- DEFAULT_API_VERSION =
2- VERSION =
"0.1.4.1"
Class Attribute Summary collapse
-
.configuration ⇒ Object
access the configuration class as Rooftop.configuration.
-
.debug_requests ⇒ Object
accessor to set whether we need to debug responses.
-
.debug_responses ⇒ Object
accessor to set whether we need to debug responses.
-
.include_drafts ⇒ Object
accessor to set whether to include drafts.
Class Method Summary collapse
-
.configure {|configuration| ... } ⇒ Object
block for configuration.
- .preview ⇒ Object
-
.preview=(preview) ⇒ Object
We’re deprecating Rooftop.preview, because Rooftop previews are done per instance.
Class Attribute Details
.configuration ⇒ Object
access the configuration class as Rooftop.configuration
20 21 22 |
# File 'lib/rooftop.rb', line 20 def configuration @configuration end |
.debug_requests ⇒ Object
accessor to set whether we need to debug responses
14 15 16 |
# File 'lib/rooftop.rb', line 14 def debug_requests @debug_requests end |
.debug_responses ⇒ Object
accessor to set whether we need to debug responses
14 15 16 |
# File 'lib/rooftop.rb', line 14 def debug_responses @debug_responses end |
.include_drafts ⇒ Object
accessor to set whether to include drafts
17 18 19 |
# File 'lib/rooftop.rb', line 17 def include_drafts @include_drafts end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
block for configuration.
23 24 25 26 27 |
# File 'lib/rooftop.rb', line 23 def configure self.configuration ||= Configuration.new yield(configuration) self.configuration.configure_connection end |
.preview ⇒ Object
35 36 37 |
# File 'lib/rooftop.rb', line 35 def preview @include_drafts end |
.preview=(preview) ⇒ Object
We’re deprecating Rooftop.preview, because Rooftop previews are done per instance.
31 32 33 |
# File 'lib/rooftop.rb', line 31 def preview=(preview) @include_drafts = preview end |