Module: Contentful::ResourceReferences
Overview
Method to retrieve references (incoming links) for a given entry or asset
Instance Method Summary collapse
-
#incoming_references(client = nil, query = {}) ⇒ Contentful::Array<Contentful::Entry>, false
Gets a collection of entries which links to current entry.
Instance Method Details
#incoming_references(client = nil, query = {}) ⇒ Contentful::Array<Contentful::Entry>, false
Gets a collection of entries which links to current entry
10 11 12 13 14 15 16 |
# File 'lib/contentful/resource_references.rb', line 10 def incoming_references(client = nil, query = {}) return false unless client query = is_a?(Contentful::Entry) ? query.merge(links_to_entry: id) : query.merge(links_to_asset: id) client.entries(query) end |