Class: Contentful::Management::Link

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

Overview

Constant Summary

Constants included from Resource::SystemProperties

Resource::SystemProperties::SYS_COERCIONS

Constants included from Resource

Resource::COERCIONS

Instance Attribute Summary

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #default_locale, #properties, #request

Instance Method Summary collapse

Methods included from Resource::SystemProperties

included, #initialize, #inspect

Methods included from Resource

#array?, #fields, #initialize, #inspect, #nested_locale_fields?, #sys

Instance Method Details

#resolve(query = {}) ⇒ Object

Queries contentful for the Resource the Link is referring to Takes an optional query hash



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

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