module Rooftop

Coerce any field called 'parent' which returns an ID into an actual object

This module allows you to alias one field as another. There's a bit of a circuitous route to getting it done, because you need to push the after_find hook call onto the end of the hash of existing hook calls. See Rooftop::HookCalls for more details.

This module exists because call order on the hooks provided by Her is important in some cases. For example in Rooftop::FieldAliases we are aliasing the content of a field, which might need to have been coerced first. So we control the order by writing (in a known order) to @hook_calls, and then iterating over them.

Code courtesty github.com/envylabs/faraday-detailed_logger - MIT licence

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)

Constants

DEFAULT_API_NAMESPACE
DEFAULT_API_VERSION
VERSION

Attributes

configuration[RW]

access the configuration class as Rooftop.configuration

debug_requests[RW]

accessor to set whether we need to debug responses

debug_responses[RW]

accessor to set whether we need to debug responses

include_drafts[RW]

accessor to set whether to include drafts

Public Class Methods

configure() { |configuration| ... } click to toggle source

block for configuration.

# File lib/rooftop.rb, line 23
def configure
  self.configuration ||= Configuration.new
  yield(configuration)
  self.configuration.configure_connection
end
preview() click to toggle source
# File lib/rooftop.rb, line 35
def preview
  @include_drafts
end
preview=(preview) click to toggle source

We're deprecating Rooftop.preview, because Rooftop previews are done per instance.

# File lib/rooftop.rb, line 31
def preview=(preview)
  @include_drafts = preview
end