Class: Contentful::Management::Link

Inherits:
Object
  • Object
show all
Includes:
Resource, Resource::SystemProperties
Defined in:
lib/contentful/management/link.rb

Overview

Instance Attribute Summary

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #default_locale, #properties, #raw_object, #request

Instance Method Summary collapse

Methods included from Resource

#array?, #destroy, #fields, #nested_locale_fields?, #resource?, #sys, #update

Instance Method Details

#resolve(query = {}) ⇒ Object

Queries contentful for the Resource the Link is referring to

Parameters:

  • query (Hash) (defaults to: {})


13
14
15
16
17
18
19
# File 'lib/contentful/management/link.rb', line 13

def resolve(query = {})
  id_and_query = [(id unless link_type == 'Space')].compact + [query]
  client.public_send(
    Contentful::Management::Support.snakify(link_type).to_sym,
    *id_and_query
  )
end